Skip to content

[fix][broker] Enable shadow topics by default - #26921

Closed
zymap wants to merge 1 commit into
apache:masterfrom
zymap:enable-shadowtopic-by-default
Closed

zymap wants to merge 1 commit into
apache:masterfrom
zymap:enable-shadowtopic-by-default

Conversation

@zymap

@zymap zymap commented Oct 15, 2026

Copy link
Copy Markdown
Member

Motivation:
PR #26739 introduced enableShadowTopics with a false default, disabling existing shadow-topic deployments unless operators explicitly enabled it. Default the new setting to true to preserve the previous behavior.

Modifications:

  • Enable shadow topics by default in ServiceConfiguration and the broker and standalone configuration files.
  • Cover the default and explicit false override in configuration loading.
  • Run ShadowTopicTest with the default setting and use a dedicated broker with the setting explicitly disabled in ShadowTopicsDisabledTest.

Validation:

  • All 31 tests in PulsarConfigurationLoaderTest, ShadowTopicTest, and ShadowTopicsDisabledTest passed with retries disabled.
  • Related Checkstyle checks and git diff --check passed.
  • Full quickCheck was blocked by an existing missing ASF license header in pulsar-client's generated NasaMission.java.

Assisted-by: OpenAI Codex

Fixes #xyz

Main Issue: #xyz

PIP: #xyz

Motivation

Modifications

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

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

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Motivation:
PR apache#26739 introduced enableShadowTopics with a false default, disabling
existing shadow-topic deployments unless operators explicitly enabled it.
Default the new setting to true to preserve the previous behavior.

Modifications:
- Enable shadow topics by default in ServiceConfiguration and the broker
  and standalone configuration files.
- Cover the default and explicit false override in configuration loading.
- Run ShadowTopicTest with the default setting and use a dedicated broker
  with the setting explicitly disabled in ShadowTopicsDisabledTest.

Validation:
- All 31 tests in PulsarConfigurationLoaderTest, ShadowTopicTest, and
  ShadowTopicsDisabledTest passed with retries disabled.
- Related Checkstyle checks and git diff --check passed.
- Full quickCheck was blocked by an existing missing ASF license header
  in pulsar-client's generated NasaMission.java.

Assisted-by: OpenAI Codex
@zymap zymap self-assigned this Oct 15, 2026
@zymap zymap added this to the 5.1.0 milestone Oct 15, 2026

@codelipenghui codelipenghui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. The change is minimal and correct, and the focused tests pass locally (ShadowTopicTest, ShadowTopicsDisabledTest, PulsarConfigurationLoaderTest; 31/31 with -PtestRetryCount=0).

Two follow-ups:

  • branch-5.0 still has enableShadowTopics = false, and 5.0.0 shipped with it. Please add release/5.0.1 as well. Otherwise an upgrade from 4.2.6 or 4.0.15 to 5.0.x disables shadow topics again.
  • This reverses the default that #26739 shipped in 4.0.14, 4.2.5 and 5.0.0. Please make sure @lhotari agrees, and add a release note (e.g. release/important-notice) so that users who rely on the disabled default know to set enableShadowTopics=false explicitly.

@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.

This is intentionally disabled.

@codelipenghui

Copy link
Copy Markdown
Contributor

@lhotari any reason to disable this feature? is there a proposal before?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants