LUCENE-8394: Explicitly handle the case when segments are smaller than the floor size.

This commit is contained in:
Adrien Grand 2018-07-10 08:50:59 +02:00
parent 8e0d9849bd
commit a864ef8231
1 changed files with 3 additions and 0 deletions

View File

@ -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() +