Skip rebalancing when cluster_concurrent_rebalance threshold reached (#33329)

Allows to skip shard balancing when the cluster_concurrent_rebalance threshold is already reached, which cuts down the time spent in the rebalance method of BalancedShardsAllocator.
This commit is contained in:
Bukhtawar 2018-09-17 16:43:44 +05:30 committed by Yannick Welsch
parent 5ca6f31205
commit 14d57c1115
1 changed files with 5 additions and 0 deletions

View File

@ -61,6 +61,11 @@ public class ConcurrentRebalanceAllocationDecider extends AllocationDecider {
@Override
public Decision canRebalance(ShardRouting shardRouting, RoutingAllocation allocation) {
return canRebalance(allocation);
}
@Override
public Decision canRebalance(RoutingAllocation allocation) {
if (clusterConcurrentRebalance == -1) {
return allocation.decision(Decision.YES, NAME, "unlimited concurrent rebalances are allowed");
}