pendingCommit in IndexWriter is not thoroughly tested
-----------------------------------------------------

                 Key: LUCENE-3116
                 URL: https://issues.apache.org/jira/browse/LUCENE-3116
             Project: Lucene - Java
          Issue Type: Test
          Components: core/index
    Affects Versions: 3.2, 4.0
            Reporter: Uwe Schindler


When working on LUCENE-3084, I had a copy-paste error in my patch (see revision 
1124307 and corrected in 1124316), I replaced pendingCommit by segmentInfos in 
IndexWriter, corrected by the following patch:

{noformat}
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java 
(original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java 
Wed May 18 16:16:29 2011
@@ -2552,7 +2552,7 @@ public class IndexWriter implements Clos
         lastCommitChangeCount = pendingCommitChangeCount;
         segmentInfos.updateGeneration(pendingCommit);
         segmentInfos.setUserData(pendingCommit.getUserData());
-        rollbackSegments = segmentInfos.createBackupSegmentInfos(true);
+        rollbackSegments = pendingCommit.createBackupSegmentInfos(true);
         deleter.checkpoint(pendingCommit, true);
       } finally {
         // Matches the incRef done in startCommit:
{noformat}

This did not cause any test failure.

On IRC, Mike said:

{quote}
[19:21] mikemccand: ThetaPh1: hmm
[19:21] mikemccand: well
[19:22] mikemccand: pendingCommit and sis only differ while commit() is running
[19:22] mikemccand: ie if a thread starts commit
[19:22] mikemccand: but fsync is taking a long time
[19:22] mikemccand: and another thread makes a change to sis
[19:22] ThetaPh1: ok so hard to find that bug
[19:22] mikemccand: we need our mock dir wrapper to sometimes take a long time 
syncing....
{quote}

Maybe we need such a test, I feel bad when such stupid changes don't make any 
test fail.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to