Skip to content

DesiredBalanceReconciler always returns AllocationStats - #122458

Merged
DiannaHohensee merged 3 commits into
elastic:mainfrom
DiannaHohensee:2025/02/12/ES-10581-test-AllocationStats
Feb 19, 2025
Merged

DiannaHohensee merged 3 commits into
elastic:mainfrom
DiannaHohensee:2025/02/12/ES-10581-test-AllocationStats

Conversation

@DiannaHohensee

Copy link
Copy Markdown
Contributor

Ensures that the DesiredBalanceReconciler always returns a non-empty AllocationStats object, eliminating edge cases where the stats available to DesiredBalanceMetrics may not be updated due to some kind of throttling or the balancer being disabled via cluster settings.

Adds documentation around AllocationDecider#canRebalance(RoutingAllocation)

Closes ES-10581


I added testing to better demonstrate the what values are set in the AllocationStats. Something notable is that the totalAllocations in AllocationStats will double count relocating shards, for example. Some of the new testing also covers cases where previously an empty AllocationStats was returned: now a non-empty one is always returned.

@DiannaHohensee DiannaHohensee added >bug :Distributed/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) Team:Distributed Coordination (obsolete) Meta label for Distributed Coordination team. Obsolete. Please do not use. labels Feb 13, 2025
@DiannaHohensee DiannaHohensee self-assigned this Feb 13, 2025
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

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

@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Hi @DiannaHohensee, I've created a changelog YAML for you.

@nicktindall nicktindall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (sorry this took so long)

@DiannaHohensee
DiannaHohensee merged commit 2bfc700 into elastic:main Feb 19, 2025
@DiannaHohensee

Copy link
Copy Markdown
Contributor Author

No worries, you've been spread thin lately. Thanks for the review.

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

Labels

>bug :Distributed/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) Team:Distributed Coordination (obsolete) Meta label for Distributed Coordination team. Obsolete. Please do not use. v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants