Lucene - Core
  1. Lucene - Core
  2. LUCENE-1976

isCurrent() and getVersion() on an NRT reader are broken

    Details

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

      Description

      Right now isCurrent() will always return true for an NRT reader and getVersion() will always return the version of the last commit. This is because the NRT reader holds the live segmentInfos.

      I think isCurrent() should return "false" when any further changes have occurred with the writer, else true. This is actually fairly easy to determine, since the writer tracks how many docs & deletions are buffered in RAM and these counters only increase with each change.

      getVersion should return the version as of when the reader was created.

      1. LUCENE-1976.patch
        9 kB
        Michael McCandless

        Activity

        Hide
        Michael McCandless added a comment -

        Attached patch. Now, for an NRT reader, isCurrent returns false if there have been any changes in the writer since it was opened.

        Show
        Michael McCandless added a comment - Attached patch. Now, for an NRT reader, isCurrent returns false if there have been any changes in the writer since it was opened.
        Hide
        Michael McCandless added a comment -

        I plan to back-port this to 2.9.x, since we're doing a 2.9.1 shortly...

        Show
        Michael McCandless added a comment - I plan to back-port this to 2.9.x, since we're doing a 2.9.1 shortly...
        Hide
        Michael McCandless added a comment -

        Bulk close all 2.9.1 issues.

        Show
        Michael McCandless added a comment - Bulk close all 2.9.1 issues.
        Hide
        Michael McCandless added a comment -

        Reopening to fix on 3.1 after flex lands...

        Show
        Michael McCandless added a comment - Reopening to fix on 3.1 after flex lands...
        Hide
        Michael McCandless added a comment -

        OK fixed on 3.1.

        Show
        Michael McCandless added a comment - OK fixed on 3.1.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development