Lucene - Core
  1. Lucene - Core
  2. LUCENE-2299

if you open an NRT reader while addIndexes* is running it may miss segments

    Details

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

      Description

      Earwin spotted this in pending ongoing refactoring of Dir/MultiReader, but I wanted to open this separately just to make sure we fix it for 3.1...

      This is the fix:

      Index: src/java/org/apache/lucene/index/DirectoryReader.java
      ===================================================================
      --- src/java/org/apache/lucene/index/DirectoryReader.java	(revision 919119)
      +++ src/java/org/apache/lucene/index/DirectoryReader.java	(working copy)
      @@ -145,7 +145,7 @@
           for (int i=0;i<numSegments;i++) {
             boolean success = false;
             try {
      -        final SegmentInfo info = infos.info(upto);
      +        final SegmentInfo info = infos.info(i);
               if (info.dir == dir) {
                 readers[upto++] = writer.readerPool.getReadOnlyClone(info, true, termInfosIndexDivisor);
               }
      
      1. LUCENE-2299.patch
        2 kB
        Michael McCandless

        Activity

        Michael McCandless created issue -
        Michael McCandless made changes -
        Field Original Value New Value
        Affects Version/s 2.9.3 [ 12314799 ]
        Affects Version/s 3.0.2 [ 12314798 ]
        Affects Version/s 3.1 [ 12314822 ]
        Affects Version/s 4.0 [ 12314025 ]
        Hide
        Shai Erera added a comment -

        Mike - is this still a problem w/ the refactoring done recently to addIndexes*? I.e., now they operate 'on the side', changing the segmentInfos in the end only ...

        Show
        Shai Erera added a comment - Mike - is this still a problem w/ the refactoring done recently to addIndexes*? I.e., now they operate 'on the side', changing the segmentInfos in the end only ...
        Hide
        Michael McCandless added a comment -

        Nope In 4.0 this is automatically fixed since addIndexes is now well behaved! Nice

        Show
        Michael McCandless added a comment - Nope In 4.0 this is automatically fixed since addIndexes is now well behaved! Nice
        Michael McCandless made changes -
        Fix Version/s 2.9.3 [ 12314799 ]
        Fix Version/s 3.0.2 [ 12314798 ]
        Fix Version/s 3.1 [ 12314822 ]
        Hide
        Michael McCandless added a comment -

        Cleans up DirReader's loading of segments from IW. I removed code since a SegmentInfo's dir is never external anymore (I won't do this when backporting to 3.0.x,2.9.x).

        Show
        Michael McCandless added a comment - Cleans up DirReader's loading of segments from IW. I removed code since a SegmentInfo's dir is never external anymore (I won't do this when backporting to 3.0.x,2.9.x).
        Michael McCandless made changes -
        Attachment LUCENE-2299.patch [ 12445982 ]
        Hide
        Shai Erera added a comment -

        In 4.0 this is automatically fixed since addIndexes is now well behaved!

        So is in 3.1.

        Show
        Shai Erera added a comment - In 4.0 this is automatically fixed since addIndexes is now well behaved! So is in 3.1.
        Hide
        Michael McCandless added a comment -

        So is in 3.1.

        Yes.

        Show
        Michael McCandless added a comment - So is in 3.1. Yes.
        Michael McCandless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Uwe Schindler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Workflow jira [ 12501086 ] Default workflow, editable Closed status [ 12564250 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12564250 ] jira [ 12583968 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        86d 2h 48m 1 Michael McCandless 01/Jun/10 14:46
        Resolved Resolved Closed Closed
        16d 17h 17m 1 Uwe Schindler 18/Jun/10 08:03

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development