Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-1474

Incorrect SegmentInfo.delCount when IndexReader.flush() is used

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4
    • 2.4.1, 2.9
    • core/index
    • None
    • New

    Description

      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)
      [...]

      Attachments

        1. CheckIndex.txt
          66 kB
          Erik van Zijst
        2. IndexReaderTest.java
          1 kB
          Marcel Reutegger

        Activity

          People

            mikemccand Michael McCandless
            mreutegg Marcel Reutegger
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: