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
[broker] Add REST API to enable or disable replicated subscriptions #10790
Conversation
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Outdated
Show resolved
Hide resolved
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.
awesome work.
I left some comments please take a look
...broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java
Outdated
Show resolved
Hide resolved
...broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorSubscriptionTest.java
Show resolved
Hide resolved
…included in the replication clusters
d6fa74b
to
b5ee9db
Compare
@eolivelli PTAL |
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 left a couple of more comments.
now that you refactored the patch I found a couple of potential problems.
can you please check ?
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Outdated
Show resolved
Hide resolved
0dc734e
to
02487e1
Compare
@eolivelli PTAL |
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
@codelipenghui do you want to take another look ?
the patch changed a little since your review
@codelipenghui @MarvinCai Can you review this PR? |
…10790) ### Motivation Currently, once a replicated subscription is created on a topic, there is no way for users to disable it. I think it is useful to have a REST API that allows users to enable or disable replicated subscriptions. ### Modifications Added the following REST API endpoints: ``` /admin/persistent/{tenant}/{cluster}/{namespace}/{topic}/subscription/{subName}/replicatedSubscriptionStatus /admin/v2/persistent/{tenant}/{namespace}/{topic}/subscription/{subName}/replicatedSubscriptionStatus ``` We can enable/disable a replicated subscription by posting true or false to these endpoints. (cherry picked from commit 1d3e92e)
### Motivation The test `testSetReplicatedSubscriptionStatus ` add by #10790, and the code `persistentTopics.createPartitionedTopic(response, testTenant, testNamespace, topicName, 2, true);` `createLocalTopicOnly` set `true`. However, when the PR cherry-pick to branch-2.8, this commit `https://github.com/apache/pulsar/commit/0706bc01a428a9405c671a0f80fb54faccdd26e6`, which lead the test run failed.
…pache#10790) ### Motivation Currently, once a replicated subscription is created on a topic, there is no way for users to disable it. I think it is useful to have a REST API that allows users to enable or disable replicated subscriptions. ### Modifications Added the following REST API endpoints: ``` /admin/persistent/{tenant}/{cluster}/{namespace}/{topic}/subscription/{subName}/replicatedSubscriptionStatus /admin/v2/persistent/{tenant}/{namespace}/{topic}/subscription/{subName}/replicatedSubscriptionStatus ``` We can enable/disable a replicated subscription by posting true or false to these endpoints.
Motivation
Currently, once a replicated subscription is created on a topic, there is no way for users to disable it. I think it is useful to have a REST API that allows users to enable or disable replicated subscriptions.
Modifications
Added the following REST API endpoints:
We can enable/disable a replicated subscription by posting true or false to these endpoints.