Skip to content

[fix][broker] Forward topic policy updates after init failures - #26110

Merged
lhotari merged 1 commit into
apache:masterfrom
Denovo1998:forward_topic_policy_updates_after_init_failures
Jun 29, 2026
Merged

[fix][broker] Forward topic policy updates after init failures#26110
lhotari merged 1 commit into
apache:masterfrom
Denovo1998:forward_topic_policy_updates_after_init_failures

Conversation

@Denovo1998

Copy link
Copy Markdown
Contributor

Motivation

PR #26044 made topic policy listeners buffer live updates until the initial topic-policy load completes, so a topic can start with the latest policy state. However, PersistentTopic.initialize() logs and continues when that initial load fails. In that path, the listener wrapper stays uninitialized, so later live topic-policy updates are buffered forever instead of being delivered to the topic.

Modifications

  • Complete the TopicPolicyListenerWrapper with empty loaded policies when the initial global/local topic-policy lookup fails.
  • Preserve the original failed future so topic loading keeps the existing log-and-continue behavior.
  • Keep buffered live updates authoritative if an update arrives before the failure handling runs.
  • Add a regression test for initial policy load failure followed by a live local topic-policy update.

Verifying this change

  • Make sure that the change passes the CI checks.

  • gradlew :pulsar-broker:test --tests org.apache.pulsar.broker.service.persistent.PersistentTopicTest.testTopicPolicyListenerForwardsLiveUpdatesAfterInitialLoadFailure --rerun-tasks

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

@lhotari lhotari added this to the 5.0.0-M2 milestone Jun 29, 2026
@lhotari
lhotari merged commit b14524e into apache:master Jun 29, 2026
44 checks passed
lhotari pushed a commit that referenced this pull request Jun 29, 2026
lhotari pushed a commit that referenced this pull request Jun 29, 2026
@Denovo1998
Denovo1998 deleted the forward_topic_policy_updates_after_init_failures branch June 30, 2026 12:14
sandeep-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 31, 2026
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Aug 28, 2026
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.

2 participants