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

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.1, 4.0-ALPHA
    • core/index
    • None
    • 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

            mikemccand Michael McCandless
            mikemccand Michael McCandless
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: