lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject [3/9] lucene-solr:master: LUCENE-8394: Explicitly handle the case when segments are smaller than the floor size.
Date Tue, 10 Jul 2018 07:28:16 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/a864ef82
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a864ef82
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a864ef82

Branch: refs/heads/master
Commit: a864ef823167380eb1e2724b453c7730b93f5bbe
Parents: 8e0d984
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:17:34 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/a864ef82/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