KAFKA-20890: Restore dynamic broker configs before startup - #23304
Open
1fanwang wants to merge 3 commits into
Open
KAFKA-20890: Restore dynamic broker configs before startup#233041fanwang wants to merge 3 commits into
1fanwang wants to merge 3 commits into
Conversation
Signed-off-by: 1fanwang <1fannnw@gmail.com> Generated-by: Claude Opus 5 (claude-opus-5)
Signed-off-by: 1fanwang <1fannnw@gmail.com> Generated-by: Claude Opus 5 (claude-opus-5)
Signed-off-by: 1fanwang <1fannnw@gmail.com> Generated-by: Claude Opus 5 (claude-opus-5)
1fanwang
force-pushed
the
fix/kafka-20890-dynamic-config-restore
branch
from
August 29, 2026 13:44
a7cbd91 to
050f997
Compare
|
A label of 'needs-attention' was automatically added to this PR in order to raise the |
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.
A broker config rolled out safely as 1, then 2, then 4 comes back as the static value 1 after a KRaft broker restarts without a current local metadata snapshot. The broker still reports 4: the dynamic cache and the cluster-default DescribeConfigs response both say 4 while the running broker uses 1. Re-applying 4 is then rejected as an invalid jump from 1, so the operator can neither see nor restore the value.
Startup builds the quota managers and other runtime components from the static config and installs the metadata publishers much later, so persisted broker configs arrive after everything that reads them was constructed. A current local snapshot hides the gap, so this surfaces only on a restart with a missing or stale one.
The broker now loads the cluster-default and per-broker configs together from the metadata loader's first complete image, before those components are built, through a short-lived publisher removed once startup continues. A restarted broker now runs with 4, reports 4, and validates a later update against 4. Live updates validate their reconfigurables before applying, and a rejected update restores the previous maps. A same-instance restart also clears values removed while the broker was offline.
Fixes https://issues.apache.org/jira/browse/KAFKA-20890
Testing
A parameterized restart regression covers all three snapshot states.
Raw output