[fix][broker] Support namespace unsubscribe when bundles are unloaded#25276
Open
zhanghaou wants to merge 4 commits intoapache:masterfrom
Open
[fix][broker] Support namespace unsubscribe when bundles are unloaded#25276zhanghaou wants to merge 4 commits intoapache:masterfrom
zhanghaou wants to merge 4 commits intoapache:masterfrom
Conversation
added 2 commits
February 28, 2026 17:03
nodece
reviewed
Mar 2, 2026
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
Outdated
Show resolved
Hide resolved
nodece
approved these changes
Mar 2, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #25276 +/- ##
============================================
- Coverage 72.81% 72.61% -0.21%
- Complexity 34134 34452 +318
============================================
Files 1959 1959
Lines 155543 155552 +9
Branches 17741 17739 -2
============================================
- Hits 113263 112947 -316
- Misses 33322 33571 +249
- Partials 8958 9034 +76
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Denovo1998
suggested changes
Mar 3, 2026
| } | ||
|
|
||
| @Test(dataProvider = "numBundles") | ||
| public void testUnsubscribeNamespaceBundleOnUnloadedBundle(Integer numBundles) throws Exception { |
Contributor
There was a problem hiding this comment.
Perhaps we can add some unit tests.
- partitioned topic (ensure all subscriptions are deleted on each partition);
- Multi-topic cross-bundle;
| } | ||
|
|
||
| return pulsar().getNamespaceService().getFullListOfTopics(nsName) | ||
| .thenCompose(topicsInNamespace -> { |
Contributor
There was a problem hiding this comment.
Can the logic of NamespaceService#getOwnedTopicListForNamespaceBundle be reused here (or switch to using targetBundle.includes)?
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
Unsubscribing at namespace/bundle level fails when the target bundle is not loaded by any broker.
This PR makes unsubscribe paths handle unloaded bundles by acquiring ownership when needed and loading topics before unsubscribing.
Modifications
Verifying this change
(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:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: