Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-5668

Off-by-1 error in TieredMergePolicy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.8.1, 4.9, 6.0
    • None
    • None
    • New

    Description

      When I was comparing performance of different UUIDs, I noticed that TMP was merging too soon and picking non-ideal merges as a result. The fix is silly:

      Index: lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java
      ===================================================================
      — lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java (revision 1593975)
      +++ lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java (working copy)
      @@ -361,7 +361,7 @@
      return spec;
      }

      • if (eligible.size() >= allowedSegCountInt) {
        + if (eligible.size() > allowedSegCountInt) {

      // OK we are over budget – find best merge!
      MergeScore bestScore = null;

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: