Skip rebalancing for single node per partition #128167
Merged
ywangd merged 2 commits intoelastic:mainfrom May 20, 2025
Merged
Conversation
If the cluster has 2 nodes and 1 in each partition. Rebalancing can be skipped when it runs per partition.
Collaborator
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
ywangd
commented
May 20, 2025
Comment on lines
+383
to
+386
| if (nodeSorter.modelNodes.length < 2) { /* skip if we only have one node */ | ||
| logger.trace("skipping rebalance as the partition has single node only"); | ||
| continue; | ||
| } |
Member
Author
There was a problem hiding this comment.
This change means we can skip rebalancing for one partition but not the other. I think that's OK. But please let me know if there are subtle connections between the two balancing rounds and must run in tandem.
nicktindall
approved these changes
May 20, 2025
Contributor
nicktindall
left a comment
There was a problem hiding this comment.
LGTM, this seems like a sensible place to put that logic after the change. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the cluster has 2 nodes in total and 1 node in each partition, rebalancing can be skipped when it runs per partition.
Relates: #126091