Rebalance when there are too many voters or standby nodes and clean up nodeRefreshTask() (from Incus)#17171
Merged
tomponline merged 2 commits intocanonical:mainfrom Dec 8, 2025
Conversation
Signed-off-by: Piotr Resztak <piotr.resztak@futurfusion.io> (cherry picked from commit 45ae831ba62b87a69ad952844000250c1486df4d) Signed-off-by: Kadin Sayani <kadin.sayani@canonical.com> License: Apache-2.0
- Use a single mutex lock/unlock, both operations happen under the same lock when needed - Add a clear needsRebalance variable for readability - Reword, move comments, and fix typo Signed-off-by: Kadin Sayani <kadin.sayani@canonical.com>
2 tasks
tomponline
added a commit
that referenced
this pull request
Dec 10, 2025
#17171 included a bad merge from baaad8a to ff0f7dc, changing `onlineStandbys != maxStandBy` to `onlineStandbys < maxStandBy`. This fixes the logic that determines `needsBalance` to match the intended behavior. ## Checklist - [x] I have read the [contributing guidelines](https://github.com/canonical/lxd/blob/main/CONTRIBUTING.md) and attest that all commits in this PR are [signed off](https://github.com/canonical/lxd/blob/main/CONTRIBUTING.md#including-a-signed-off-by-line-in-your-commits), [cryptographically signed](https://github.com/canonical/lxd/blob/main/CONTRIBUTING.md#commit-signature-verification), and follow this project's [commit structure](https://github.com/canonical/lxd/blob/main/CONTRIBUTING.md#commit-structure). - [x] I have checked and added or updated relevant documentation.
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.
Checklist