Skip to content

[fix][broker] Log only non-default settings at broker startup - #26612

Merged
lhotari merged 1 commit into
apache:masterfrom
merlimat:mmerli/log-only-config-overrides
Sep 17, 2026
Merged

lhotari merged 1 commit into
apache:masterfrom
merlimat:mmerli/log-only-config-overrides

Conversation

@merlimat

Copy link
Copy Markdown
Contributor

Motivation

The Messaging service is ready log 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.runtimeConfigurationOverrides correctly compares each declared field against a fresh default instance, but it then copies every key of the loaded properties file into the result with putIfAbsent. Since broker.conf and standalone.conf list nearly every setting explicitly, all the default-valued fields the first pass filtered out are re-added by the second.

Modifications

  • runtimeConfigurationOverrides now records the names of the declared @FieldContext fields and skips any properties-file key backed by one of them, since those were already compared against their defaults.
  • Keys that are not declared fields (embedded bookie settings in standalone, plugin-consumed keys such as token*) are still reported, matching the documented behavior.
  • Extended PulsarConfigurationLoaderTest#testRuntimeConfigurationOverrides to put default-valued declared fields into the properties object and assert they are not reported.

Verifying this change

  • Make sure that the change passes the CI checks.

PulsarConfigurationLoaderTest passes; checkstyle is clean for pulsar-broker-common.

Does this pull request potentially affect one of the following parts:

  • Dependencies: no
  • The public API: no
  • The schema: no
  • The default values of configurations: no
  • The threading model: no
  • The binary protocol: no
  • The REST endpoints: no
  • The admin CLI options: no
  • The metrics: no
  • Anything that affects deployment: no

`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.
@merlimat
merlimat requested a review from lhotari September 16, 2026 22:38
@merlimat merlimat added this to the 5.0.0 milestone Sep 16, 2026

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for fixing the startup configuration filtering and adding regression coverage.

@lhotari
lhotari merged commit 6d30020 into apache:master Sep 17, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants