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:
parent
5ca6f31205
commit
14d57c1115
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue