From ebc0c8cc6d8fc35b84d1ee8bd3255729f361d4aa Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Fri, 1 Feb 2013 18:58:39 +0100 Subject: [PATCH] when we fix maxMergeAtOnce, make sure to not set it to 1 as its an illegal value --- .../index/merge/policy/TieredMergePolicyProvider.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/elasticsearch/index/merge/policy/TieredMergePolicyProvider.java b/src/main/java/org/elasticsearch/index/merge/policy/TieredMergePolicyProvider.java index 26546eeeea6..2670484bb1a 100644 --- a/src/main/java/org/elasticsearch/index/merge/policy/TieredMergePolicyProvider.java +++ b/src/main/java/org/elasticsearch/index/merge/policy/TieredMergePolicyProvider.java @@ -82,6 +82,10 @@ public class TieredMergePolicyProvider extends AbstractIndexShardComponent imple // fixing maxMergeAtOnce, see TieredMergePolicy#setMaxMergeAtOnce if (!(segmentsPerTier >= maxMergeAtOnce)) { int newMaxMergeAtOnce = (int) segmentsPerTier; + // max merge at once should be at least 2 + if (newMaxMergeAtOnce <= 1) { + newMaxMergeAtOnce = 2; + } logger.debug("[tiered] merge policy changing max_merge_at_once from [{}] to [{}] because segments_per_tier [{}] has to be higher or equal to it", maxMergeAtOnce, newMaxMergeAtOnce, segmentsPerTier); this.maxMergeAtOnce = newMaxMergeAtOnce; }