-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Simulate shard moves using cluster_concurrent_rebalance=2 #93977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simulate shard moves using cluster_concurrent_rebalance=2 #93977
Conversation
BalancedShardAllocator is prone to perform unnecessary moves when cluster_concurrent_rebalance is set to high values (>2). (See elastic#87279) Above allocator is used in DesiredBalanceComputer. Since we do not move actual shard data during calculation it is possible to artificially set above setting to 1 to avoid unnecessary moves in desired balance.
Pinging @elastic/es-distributed (Team:Distributed) |
Hi @idegtiarenko, I've created a changelog YAML for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one minor comment about how we make sure we're only testing one of the allocators tho. Not essential, but I'd prefer it.
assumeTrue( | ||
"Only fixed in DesiredBalanceShardsAllocator", | ||
allocationService.shardsAllocator instanceof DesiredBalanceShardsAllocator | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nicer to change it so that org.elasticsearch.cluster.ESAllocationTestCase#createShardsAllocator
respects the cluster.routing.allocation.type
setting if set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one optional comment/question
@@ -62,10 +62,17 @@ public Decision canRebalance(ShardRouting shardRouting, RoutingAllocation alloca | |||
|
|||
@Override | |||
public Decision canRebalance(RoutingAllocation allocation) { | |||
int relocatingShards = allocation.routingNodes().getRelocatingShardCount(); | |||
if (allocation.isSimulating() && relocatingShards >= 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should use 2
here just for consistency with the past default behaviour? I think I've seen odd things happening at 1
sometimes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a chance you could describe or link some of them?
May be we could add some tests for them and assess the better value
# Conflicts: # test/framework/src/main/java/org/elasticsearch/cluster/ESAllocationTestCase.java
@elasticsearchmachine please run elasticsearch-ci/bwc |
💚 Backport successful
|
) BalancedShardAllocator is prone to perform unnecessary moves when cluster_concurrent_rebalance is set to high values (>2). (See elastic#87279) Above allocator is used in DesiredBalanceComputer. Since we do not move actual shard data during calculation it is possible to artificially set above setting to 2 to avoid unnecessary moves in desired balance.
…) (#94082) * Simulate shard moves using cluster_concurrent_rebalance=2 (#93977) BalancedShardAllocator is prone to perform unnecessary moves when cluster_concurrent_rebalance is set to high values (>2). (See #87279) Above allocator is used in DesiredBalanceComputer. Since we do not move actual shard data during calculation it is possible to artificially set above setting to 2 to avoid unnecessary moves in desired balance. * fix merge --------- Co-authored-by: Elastic Machine <[email protected]>
BalancedShardAllocator is prone to perform unnecessary moves when cluster_concurrent_rebalance is set to high values (>2). (See #87279)
Above allocator is used in DesiredBalanceComputer. Since we do not move actual shard data during calculation
it is possible to artificially set above setting to 1 to avoid unnecessary moves in desired balance.
Related to: #87279