Lucene - Core
  1. Lucene - Core
  2. LUCENE-1474

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4.1, 2.9
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      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)
      [...]

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

        Activity

        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12563102 ] jira [ 12584149 ]
        Mark Thomas made changes -
        Workflow jira [ 12447479 ] Default workflow, editable Closed status [ 12563102 ]
        Mark Miller made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Erik van Zijst made changes -
        Attachment CheckIndex.txt [ 12408755 ]
        Michael McCandless made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Michael McCandless made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Michael McCandless made changes -
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Resolved [ 5 ]
        Michael McCandless made changes -
        Fix Version/s 2.4.1 [ 12313516 ]
        Michael McCandless made changes -
        Status Resolved [ 5 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Michael McCandless made changes -
        Fix Version/s 2.9 [ 12312682 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Michael McCandless made changes -
        Assignee Michael McCandless [ mikemccand ]
        Marcel Reutegger made changes -
        Field Original Value New Value
        Attachment IndexReaderTest.java [ 12395129 ]
        Marcel Reutegger created issue -

          People

          • Assignee:
            Michael McCandless
            Reporter:
            Marcel Reutegger
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development