You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2014/07/29 08:57:46 UTC
svn commit: r1614264 - in
/lucene/dev/trunk/lucene/replicator/src/java/org/apache/lucene/replicator:
IndexAndTaxonomyReplicationHandler.java IndexReplicationHandler.java
Author: shaie
Date: Tue Jul 29 06:57:46 2014
New Revision: 1614264
URL: http://svn.apache.org/r1614264
Log:
LUCENE-5852: log errors that occur during cleanupOldIndexFiles
Modified:
lucene/dev/trunk/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyReplicationHandler.java
lucene/dev/trunk/lucene/replicator/src/java/org/apache/lucene/replicator/IndexReplicationHandler.java
Modified: lucene/dev/trunk/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyReplicationHandler.java?rev=1614264&r1=1614263&r2=1614264&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyReplicationHandler.java (original)
+++ lucene/dev/trunk/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyReplicationHandler.java Tue Jul 29 06:57:46 2014
@@ -166,8 +166,8 @@ public class IndexAndTaxonomyReplication
// side-effects, e.g. if it hits sudden IO errors while opening the index
// (and can end up deleting the entire index). It is not our job to protect
// against those errors, app will probably hit them elsewhere.
- IndexReplicationHandler.cleanupOldIndexFiles(indexDir, indexSegmentsFile);
- IndexReplicationHandler.cleanupOldIndexFiles(taxoDir, taxoSegmentsFile);
+ IndexReplicationHandler.cleanupOldIndexFiles(indexDir, indexSegmentsFile, infoStream);
+ IndexReplicationHandler.cleanupOldIndexFiles(taxoDir, taxoSegmentsFile, infoStream);
// successfully updated the index, notify the callback that the index is
// ready.
Modified: lucene/dev/trunk/lucene/replicator/src/java/org/apache/lucene/replicator/IndexReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/replicator/src/java/org/apache/lucene/replicator/IndexReplicationHandler.java?rev=1614264&r1=1614263&r2=1614264&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/replicator/src/java/org/apache/lucene/replicator/IndexReplicationHandler.java (original)
+++ lucene/dev/trunk/lucene/replicator/src/java/org/apache/lucene/replicator/IndexReplicationHandler.java Tue Jul 29 06:57:46 2014
@@ -141,7 +141,7 @@ public class IndexReplicationHandler imp
* directory. It suppresses any exceptions that occur, as this can be retried
* the next time.
*/
- public static void cleanupOldIndexFiles(Directory dir, String segmentsFile) {
+ public static void cleanupOldIndexFiles(Directory dir, String segmentsFile, InfoStream infoStream) {
try {
IndexCommit commit = getLastCommit(dir);
// commit == null means weird IO errors occurred, ignore them
@@ -164,9 +164,12 @@ public class IndexReplicationHandler imp
}
}
} catch (Throwable t) {
- // ignore any errors that happens during this state and only log it. this
+ // ignore any errors that happen during this state and only log it. this
// cleanup will have a chance to succeed the next time we get a new
// revision.
+ if (infoStream.isEnabled(INFO_STREAM_COMPONENT)) {
+ infoStream.message(INFO_STREAM_COMPONENT, "cleanupOldIndexFiles(): failed on error " + t.getMessage());
+ }
}
}
@@ -280,7 +283,7 @@ public class IndexReplicationHandler imp
// side-effects, e.g. if it hits sudden IO errors while opening the index
// (and can end up deleting the entire index). It is not our job to protect
// against those errors, app will probably hit them elsewhere.
- cleanupOldIndexFiles(indexDir, segmentsFile);
+ cleanupOldIndexFiles(indexDir, segmentsFile, infoStream);
// successfully updated the index, notify the callback that the index is
// ready.