allocator: coordinate graceful exit of signaled members#457
Open
williamhbaker wants to merge 2 commits intomasterfrom
Open
allocator: coordinate graceful exit of signaled members#457williamhbaker wants to merge 2 commits intomasterfrom
williamhbaker wants to merge 2 commits intomasterfrom
Conversation
afa2aaa to
ba91114
Compare
ba91114 to
d4cb4cc
Compare
6cbd88b to
258db2d
Compare
Allow scenarios like unattended upgrades where many members are signaled to exit at once. Members now mark themselves as exiting rather than zeroing their item limit, and the allocator gradually sheds their capacity from available excess slots, oldest first, capped so that enough members remain to satisfy replication. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When deploying to existing clusters, old allocators don't understand the Exiting field and need to see a zeroed limit to drain items from exiting members. Revert this commit once the cluster is fully upgraded. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
258db2d to
42a4400
Compare
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.
Allow scenarios like unattended upgrades where many members are signaled to exit at once. Members now mark themselves as exiting rather than zeroing their item limit, and the allocator gradually sheds their capacity from available excess slots, oldest first, capped so that enough members remain to satisfy replication.
A two step deployment will be needed for this, since allocators running the old code won't know about the "Exiting" flag or how to shed load from exiting brokers. Initially members running the new code will need to continue to zero their item limit when signaled to exit, and then a second deploy can remove that zero'ing to achieve the desired load shedding.
The first commit of this series (94104c1) is the as-new code; the second (258db2d) includes the backward compatibility adjustments. Once this PR is merged and fully deployed everywhere, a follow-up PR can revert that second commit which can then be deployed to finalize the change.
The benchmarks for the Allocator in
allocator/benchmark_test.gowere ran before and after this change and produced identical results. Also added a scenario to simulate scaling down first, followed by replacement: This is not a scenario that the previous version of code can model with its zero-limiting instead of partial "shed" capacities, so there's not a before & after comparison; but it may be informative to note that the down-then-up benchmark shows 10-20% more churn than the up-then-down case.Manual tests performed: