GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [fix][broker] Propagate migration policy read failures during topic loading by oneby-wang · Pull Request #27579 · apache/pulsar

Conversation

@oneby-wang

@oneby-wang oneby-wang commented Nov 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Motivation

When the migration policy read failed during a persistent topic reload, checkTopicAlreadyMigrated ignored the exception and unboxed a null isMigrated. The resulting NullPointerException failed a discarded handle stage. The separate future returned by the migration check never completed, so getTopic reported a topic load timeout and hid the original metadata error.

Modifications

Return the thenCompose stage directly so a failed policy read reaches the caller with its original cause. A successful read still allows the load for an unmigrated topic and rejects a migrated topic with TopicMigratedException.

Verifying this change

  • Make sure that the change passes the CI checks.

  • testPersistentTopicReloadPropagatesMigrationPolicyFailure reproduced the broker timeout before the fix. With the fix, the same reload returns the exact MetadataStoreException injected by the test.

  • testPersistentTopicReloadHonorsClusterMigration verifies that the same topic reloads before migration and is rejected afterward under both load managers.

  • Local validation passed with retries disabled: all 70 BrokerServiceTest cases, both migration test instances, and quickCheck.

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

  • 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 — the existing topic load failure counter can now record a policy read failure under a non-timeout reason.
  • Anything that affects deployment

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@oneby-wang
[fix][broker] Propagate migration policy read failures during topic l…
28ca601
…oading

Assisted-by: OpenAI Codex (GPT-6)
codelipenghui
codelipenghui approved these changes Nov 11, 2026
View reviewed changes
lhotari
lhotari approved these changes Nov 11, 2026
View reviewed changes

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM. Thanks for tracking down the hidden timeout and adding a test that reproduces it.

Returning the thenCompose stage directly fixes the root cause: the old handle ignored ex and NPE'd on the null isMigrated in a discarded stage. The failure now reaches the existing exceptionally in createPersistentTopic0, which unwraps it via failTopicFuture, and the TopicMigratedException path keeps the same wrapping. I also checked that testPersistentTopicReloadPropagatesMigrationPolicyFailure pins the fix: with the old handle code restored it fails with the topic load timeout, and with the fix it passes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lhotari lhotari mentioned this pull request Nov 12, 2026
[fix][broker] Log consumer migration notification failures #27595
Merged
11 tasks
@lhotari
lhotari merged commit 6b741a4 into apache:master Nov 12, 2026
44 of 45 checks passed

Uh oh!

There was an error while loading. Please reload this page.

lhotari pushed a commit that referenced this pull request Nov 17, 2026
@oneby-wang @lhotari
[fix][broker] Propagate migration policy read failures during topic l…
d860636
…oading (#27579)

(cherry picked from commit 6b741a4)
@lhotari lhotari added release/5.0.2 cherry-picked/branch-5.0 labels Nov 17, 2026
This was referenced Nov 21, 2026
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27680
Closed
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27681
Closed
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27684
Closed
@lhotari lhotari added cherry-picked/branch-4.2 release/4.2.6 cherry-picked/branch-4.0 release/4.0.15 labels Nov 21, 2026
poorbarcode pushed a commit to poorbarcode/pulsar that referenced this pull request Nov 26, 2026
@oneby-wang @lhotari
[fix][broker] Propagate migration policy read failures during topic l…
a2ec6e0
…oading (apache#27579)

(cherry picked from commit 6b741a4)
poorbarcode pushed a commit to poorbarcode/pulsar that referenced this pull request Nov 26, 2026
@oneby-wang @lhotari
[fix][broker] Propagate migration policy read failures during topic l…
6dd5b1c
…oading (apache#27579)

(cherry picked from commit 6b741a4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lhotari lhotari lhotari approved these changes
@codelipenghui codelipenghui codelipenghui approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cherry-picked/branch-4.0 cherry-picked/branch-4.2 cherry-picked/branch-5.0 release/4.0.15 release/4.2.6 release/5.0.2

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@oneby-wang @lhotari @codelipenghui
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.