Repository navigation
[fix][broker] Log only non-default settings at broker startup - #26612
Merged
Merged
Conversation
`runtimeConfigurationOverrides` compared each declared field against its default, but then copied every key of the loaded properties file into the result with `putIfAbsent`. Since broker.conf and standalone.conf list nearly every setting explicitly, the "Messaging service is ready" log line still printed the whole configuration. Skip properties-file keys that are backed by a declared `@FieldContext` field: those were already compared against their defaults. Keys that are not declared fields (embedded bookie settings, plugin settings) are still reported.
lhotari
approved these changes
Sep 17, 2026
lhotari
left a comment
Member
There was a problem hiding this comment.
LGTM. Thanks for fixing the startup configuration filtering and adding regression coverage.
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.
Motivation
The
Messaging service is readylog line at broker startup is meant to print only the settings that differ from their defaults (configOverrides). In practice it still prints the whole configuration, several hundred entries on a single line.PulsarConfigurationLoader.runtimeConfigurationOverridescorrectly compares each declared field against a fresh default instance, but it then copies every key of the loaded properties file into the result withputIfAbsent. Sincebroker.confandstandalone.conflist nearly every setting explicitly, all the default-valued fields the first pass filtered out are re-added by the second.Modifications
runtimeConfigurationOverridesnow records the names of the declared@FieldContextfields and skips any properties-file key backed by one of them, since those were already compared against their defaults.token*) are still reported, matching the documented behavior.PulsarConfigurationLoaderTest#testRuntimeConfigurationOverridesto put default-valued declared fields into the properties object and assert they are not reported.Verifying this change
PulsarConfigurationLoaderTestpasses; checkstyle is clean forpulsar-broker-common.Does this pull request potentially affect one of the following parts: