[ https://issues.apache.org/jira/browse/LUCENE-1474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711424#action_12711424 ]
Michael McCandless commented on LUCENE-1474: -------------------------------------------- OK, thanks. Let's try this: {code} Index: src/java/org/apache/lucene/index/SegmentReader.java =================================================================== --- src/java/org/apache/lucene/index/SegmentReader.java (revision 768598) +++ src/java/org/apache/lucene/index/SegmentReader.java (working copy) @@ -592,6 +592,7 @@ si.setDelCount(si.getDelCount()+pendingDeleteCount); pendingDeleteCount = 0; + assert deletedDocs.count() == si.getDelCount(): "delete count mismatch during commit: info=" + si.getDelCount() + " vs BitVector=" + deletedDocs.count(); } if (undeleteAll && si.hasDeletions()) { si.clearDelGen(); {code} Hopefully you see that assert trip at some point "interesting" (ie, before the assert above). > Incorrect SegmentInfo.delCount when IndexReader.flush() is used > --------------------------------------------------------------- > > Key: LUCENE-1474 > URL: https://issues.apache.org/jira/browse/LUCENE-1474 > Project: Lucene - Java > Issue Type: Bug > Components: Index > Affects Versions: 2.4 > Reporter: Marcel Reutegger > Assignee: Michael McCandless > Fix For: 2.4.1, 2.9 > > Attachments: IndexReaderTest.java > > > When deleted documents are flushed using IndexReader.flush() the delCount in > SegmentInfo is updated based on the current value and > SegmentReader.pendingDeleteCount (introduced by LUCENE-1267). It seems that > pendingDeleteCount is not reset after the commit, which means after a second > flush() or close() of an index reader the delCount in SegmentInfo is > incorrect. A subsequent IndexReader.open() call will fail with an error when > assertions are enabled. E.g.: > java.lang.AssertionError: delete count mismatch: info=3 vs BitVector=2 > at > org.apache.lucene.index.SegmentReader.loadDeletedDocs(SegmentReader.java:405) > [...] -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org