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 09:02:06 UTC

svn commit: r1614267 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/replicator/ lucene/replicator/src/java/org/apache/lucene/replicator/

Author: shaie
Date: Tue Jul 29 07:02:05 2014
New Revision: 1614267

URL: http://svn.apache.org/r1614267
Log:
LUCENE-5852: log errors that occur during cleanupOldIndexFiles

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/replicator/   (props changed)
    lucene/dev/branches/branch_4x/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyReplicationHandler.java
    lucene/dev/branches/branch_4x/lucene/replicator/src/java/org/apache/lucene/replicator/IndexReplicationHandler.java

Modified: lucene/dev/branches/branch_4x/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyReplicationHandler.java?rev=1614267&r1=1614266&r2=1614267&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyReplicationHandler.java (original)
+++ lucene/dev/branches/branch_4x/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyReplicationHandler.java Tue Jul 29 07:02:05 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/branches/branch_4x/lucene/replicator/src/java/org/apache/lucene/replicator/IndexReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/replicator/src/java/org/apache/lucene/replicator/IndexReplicationHandler.java?rev=1614267&r1=1614266&r2=1614267&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/replicator/src/java/org/apache/lucene/replicator/IndexReplicationHandler.java (original)
+++ lucene/dev/branches/branch_4x/lucene/replicator/src/java/org/apache/lucene/replicator/IndexReplicationHandler.java Tue Jul 29 07:02:05 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.