Uploaded image for project: '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
    • Status: Closed
    • Priority: 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);
               }
      

        Attachments

        1. LUCENE-2299.patch
          2 kB
          Michael McCandless

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: