You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2013/04/25 21:03:59 UTC

svn commit: r1475906 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/core/ lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java

Author: mikemccand
Date: Thu Apr 25 19:03:59 2013
New Revision: 1475906

URL: http://svn.apache.org/r1475906
Log:
LUCENE-4738: only CheckIndex when the last commit is > segments_1

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java

Modified: lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java?rev=1475906&r1=1475905&r2=1475906&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java Thu Apr 25 19:03:59 2013
@@ -136,7 +136,13 @@ public class TestIndexWriterOnJRECrash e
         if (VERBOSE) {
           System.err.println("Checking index: " + file);
         }
-        _TestUtil.checkIndex(dir);
+        // LUCENE-4738: if we crashed while writing first
+        // commit it's possible index will be corrupt (by
+        // design we don't try to be smart about this case
+        // since that too risky):
+        if (SegmentInfos.getLastCommitGeneration(dir) > 1) {
+          _TestUtil.checkIndex(dir);
+        }
         dir.close();
         return true;
       }