Lucene - Core
  1. Lucene - Core
  2. LUCENE-2809

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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.

        Activity

        Hide
        Michael McCandless added a comment -

        Committed to 4.0, 3.x... I'll leave this open to remind us to backport if we ever do another 2.9.x/3.0.x release.

        Show
        Michael McCandless added a comment - Committed to 4.0, 3.x... I'll leave this open to remind us to backport if we ever do another 2.9.x/3.0.x release.
        Hide
        Michael McCandless added a comment -

        Let's just resolve it (against 3.1/4.0) and if we do another 2.9/3.0 release we can reopen for backport.

        Show
        Michael McCandless added a comment - Let's just resolve it (against 3.1/4.0) and if we do another 2.9/3.0 release we can reopen for backport.
        Hide
        Grant Ingersoll added a comment -

        Bulk close for 3.1

        Show
        Grant Ingersoll added a comment - Bulk close for 3.1

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development