Skip to content

Conversation

@nicktindall
Copy link
Contributor

@nicktindall nicktindall commented May 28, 2025

When we're reconciling a desired balance, we round-robin to ensure we evacuate shards fairly from all nodes that need evacuation (see DesiredBalance#moveOrdering). We do not currently round-robin the destination of those movements, we merely make the first move that is allowed.

This change updates DesiredBalance#allocationOrdering each time we move a shard TO a node, and sorts the candidate target node IDs for a move by that ordering. This means that when given a choice, we will prioritise the least-recently moved-to or allocated-to node for each move.

Relates: ES-11706

@nicktindall nicktindall changed the title Redistribute shards evenly Redistribute shards evenly when reconciling May 29, 2025
@nicktindall nicktindall added >non-issue :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) labels May 29, 2025
@nicktindall nicktindall marked this pull request as ready for review May 29, 2025 04:39
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Coordination Meta label for Distributed Coordination team label May 29, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination)

@nicktindall
Copy link
Contributor Author

Actually may not be necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >non-issue Team:Distributed Coordination Meta label for Distributed Coordination team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants