Skip to content

Commit

Permalink
Skip rebalancing when cluster_concurrent_rebalance threshold reached (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Bukhtawar authored and ywelsch committed Sep 17, 2018
1 parent 5bdfa92 commit e5c0c02
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ private void setClusterConcurrentRebalance(int concurrentRebalance) {

@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");
}
Expand Down

0 comments on commit e5c0c02

Please sign in to comment.