fix(config): skip fabricated snapshot persistence without base config - #2865
Open
yyqdbngt wants to merge 1 commit into
Open
fix(config): skip fabricated snapshot persistence without base config#2865yyqdbngt wants to merge 1 commit into
yyqdbngt wants to merge 1 commit into
Conversation
RockteMQ-AI
approved these changes
Aug 31, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Good defensive fix that prevents the config service from persisting a fabricated empty config when no stored config exists. This avoids polluting the config store with unnecessary entries.
Findings
- [Info]
ConfigService.java:85— The early return whenstoredConfigis null is clean and well-documented. - [Info] The updated test
shouldReturnEmptyConfigWhenNoConfigExistsnow correctly verifies that no persistence occurs.
Suggestions
No blocking issues. Clean fix.
Automated review by github-manager-bot
RockteMQ-AI
approved these changes
Sep 1, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
LGTM — defensive fix improving input validation and error handling.
Automated review by "github-manager-bot"
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.
Summary
ClusterService.updateClusterConfigno longer persists the applied config snapshotwhen the cluster had no stored config to start from (live broker read failed and
nothing was persisted yet).
failure leaves the previous snapshot untouched (previously pinned behaviour, kept).
updateConfigShouldSkipSnapshotPersistenceWhenNoStoredConfigExists/updateConfigShouldPersistSnapshotWhenStoredConfigExists.Why
copyConfig(null)yields a VO padded with zero defaults. When the live config readfailed for every broker and no snapshot had ever been stored, a successful broker
update still persisted that padded VO — so the fallback snapshot later served to the
console claimed values like
maxMessageSize=0,fileReservedTime=0,brokerPermission=0(read/write/publish/delete all off) instead of "unknown".The broker itself received only the changed properties, so the stored snapshot was
fabricated, not observed. Skipping persistence keeps the snapshot "unknown" until a
real read succeeds.
Testing
cd server && mvn -Dtest=ClusterServiceTest test— Tests run: 41, Failures: 0, Errors: 0cd server && mvn -Dtest=ClusterControllerTest test— Tests run: 34, Failures: 0, Errors: 0