lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject [8/9] lucene-solr:branch_7x: LUCENE-8394: Explicitly handle the case when segments are smaller than the floor size.
Date Tue, 10 Jul 2018 07:28:21 GMT
LUCENE-8394: Explicitly handle the case when segments are smaller than the floor size.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/318fa538
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/318fa538
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/318fa538

Branch: refs/heads/branch_7x
Commit: 318fa538a84d332b7421fb5211a66b0cba8c86ee
Parents: 97833b7
Author: Adrien Grand <jpountz@gmail.com>
Authored: Tue Jul 10 08:50:59 2018 +0200
Committer: Adrien Grand <jpountz@gmail.com>
Committed: Tue Jul 10 09:18:17 2018 +0200

----------------------------------------------------------------------
 .../core/src/java/org/apache/lucene/index/TieredMergePolicy.java  | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/318fa538/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java b/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java
index 499273d..7f917bb 100644
--- a/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java
+++ b/lucene/core/src/java/org/apache/lucene/index/TieredMergePolicy.java
@@ -410,6 +410,9 @@ public class TieredMergePolicy extends MergePolicy {
       bytesLeft -= segsPerTier * levelSize;
       levelSize = Math.min(maxMergedSegmentBytes, levelSize * mergeFactor);
     }
+    // allowedSegCount may occasionally be less than segsPerTier
+    // if segment sizes are below the floor size
+    allowedSegCount = Math.max(allowedSegCount, segsPerTier);
 
     if (verbose(mergeContext) && tooBigCount > 0) {
       message("  allowedSegmentCount=" + allowedSegCount + " vs count=" + infos.size() +


Mime
View raw message