Skip to content

Commit e5c0c02

Browse files
Bukhtawarywelsch
authored andcommitted
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.
1 parent 5bdfa92 commit e5c0c02

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ConcurrentRebalanceAllocationDecider.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ private void setClusterConcurrentRebalance(int concurrentRebalance) {
6161

6262
@Override
6363
public Decision canRebalance(ShardRouting shardRouting, RoutingAllocation allocation) {
64+
return canRebalance(allocation);
65+
}
66+
67+
@Override
68+
public Decision canRebalance(RoutingAllocation allocation) {
6469
if (clusterConcurrentRebalance == -1) {
6570
return allocation.decision(Decision.YES, NAME, "unlimited concurrent rebalances are allowed");
6671
}

0 commit comments

Comments
 (0)