Skip to content
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

Merged
merged 12 commits into from Jun 25, 2021

Conversation

massakam
Copy link
Contributor

@massakam massakam commented Jun 3, 2021

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.

@massakam massakam added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/broker labels Jun 3, 2021
@massakam massakam added this to the 2.8.0 milestone Jun 3, 2021
@massakam massakam self-assigned this Jun 3, 2021
Copy link
Contributor

@eolivelli eolivelli left a 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

@codelipenghui codelipenghui modified the milestones: 2.8.0, 2.9.0 Jun 5, 2021
@massakam massakam changed the title [broker] Add REST API to enable or disable replicated subscriptions [WIP][broker] Add REST API to enable or disable replicated subscriptions Jun 9, 2021
@massakam massakam changed the title [WIP][broker] Add REST API to enable or disable replicated subscriptions [broker] Add REST API to enable or disable replicated subscriptions Jun 9, 2021
@massakam
Copy link
Contributor Author

massakam commented Jun 9, 2021

@eolivelli PTAL

Copy link
Contributor

@eolivelli eolivelli left a 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 ?

@massakam
Copy link
Contributor Author

@eolivelli PTAL

Copy link
Contributor

@eolivelli eolivelli left a 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

@sijie
Copy link
Member

sijie commented Jun 18, 2021

@codelipenghui @MarvinCai Can you review this PR?

@sijie sijie merged commit 1d3e92e into apache:master Jun 25, 2021
@massakam massakam deleted the disable-repl-sub branch June 29, 2021 04:03
codelipenghui pushed a commit that referenced this pull request Jul 7, 2021
…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)
@codelipenghui codelipenghui added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Jul 7, 2021
codelipenghui pushed a commit that referenced this pull request Aug 13, 2021
### 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.
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker cherry-picked/branch-2.8 Archived: 2.8 is end of life release/2.8.1 type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants