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

IndexWriter.numDocs doesn't take into account applied but not flushed deletes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      The javadoc states that buffered deletes are not taken into account and so you must call commit first.

      But, if you do that, and you're using CMS, and you're unlucky enough to have a background merge commit just after you call commit but before you call .numDocs, you can still get a wrong count back.

      The fix is trivial – numDocs should also consult any pooled readers for their current del count.

      This is causing an intermittent failure in the new TestNRTThreads.

        Attachments

          Activity

            People

            • Assignee:
              mikemccand Michael McCandless
              Reporter:
              mikemccand Michael McCandless
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: