-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue 6043] Support force deleting subscription #6383
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d9b461c
Support force deleting subscription.
murong00 62924a1
Fix a unit test
murong00 de4eb0f
Fix a flaky test
murong00 7452bca
Improve the unit test to cover force deleting
murong00 07a222e
Address penghui's comment
murong00 221b91f
Add an override method to avoid API breaking change
murong00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -769,6 +769,30 @@ PartitionedTopicInternalStats getPartitionedInternalStats(String topic) | |
*/ | ||
CompletableFuture<PartitionedTopicInternalStats> getPartitionedInternalStatsAsync(String topic); | ||
|
||
/** | ||
* Delete a subscription. | ||
* <p> | ||
* Delete a persistent subscription from a topic. There should not be any active consumers on the subscription. | ||
* <p> | ||
* | ||
* @param topic | ||
* topic name | ||
* @param subName | ||
* Subscription name | ||
* @param force | ||
* Delete topic forcefully | ||
* | ||
* @throws NotAuthorizedException | ||
* Don't have admin permission | ||
* @throws NotFoundException | ||
* Topic or subscription does not exist | ||
* @throws PreconditionFailedException | ||
* Subscription has active consumers | ||
* @throws PulsarAdminException | ||
* Unexpected error | ||
*/ | ||
void deleteSubscription(String topic, String subName, boolean force) throws PulsarAdminException; | ||
|
||
/** | ||
* Delete a subscription. | ||
* <p> | ||
|
@@ -801,10 +825,12 @@ PartitionedTopicInternalStats getPartitionedInternalStats(String topic) | |
* topic name | ||
* @param subName | ||
* Subscription name | ||
* @param force | ||
* Delete topic forcefully | ||
* | ||
* @return a future that can be used to track when the subscription is deleted | ||
*/ | ||
CompletableFuture<Void> deleteSubscriptionAsync(String topic, String subName); | ||
CompletableFuture<Void> deleteSubscriptionAsync(String topic, String subName, boolean force); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an API breaking change. You can't directly change the method signature. Please add an override method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added, thanks. |
||
|
||
/** | ||
* Skip all messages on a topic subscription. | ||
|
Oops, something went wrong.
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.
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.
This will be a flaky test since the consumer can create a subscription when they reconnect to the broker.
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.
yes, maybe we can disable this line in this pr first and then refine it later when the ability to disable the subscription auto-creation is available?
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.
I hava fixed the unit test to cover this.