-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Support delete inactive topic when subscriptions caught up #6077
Conversation
run integration tests |
run java8 tests |
run cpp tests |
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.
@codelipenghui overall looks good. however we need to take care of two things:
- the backward compatibility of the newly introduced setting.
- what is the "inactive" behavior for subscriptions all caught up? IMO A topic should be treated as an inactive topic in
delete_when_subscriptions_caught_up
mode when meet all the following conditions:
a) no messages published for a while (larger than the max inactive duration).
b) no producers connected to this topic.
c) no backlog.
I don't think we need to check if there are consumers connected.
Also I noticed that you indicated that this pull request fixes #4824. However I don't think this pull request fixes the problem in #4824. So that would be considered to remove from the description. Otherwise when we close this pull request, it will accidentally close #4824
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Outdated
Show resolved
Hide resolved
@sijie I have addressed your comments, please help take a look. |
@codelipenghui the change looks good to me. I labeled this issue as |
Add label release-2.5.1, due #6310 dependency |
### Motivation Currently, pulsar support delete inactive topic which has no active producers and no subscriptions. This pull request is support to delete inactive topics that all subscriptions of the topic are caught up and no active producers/consumer. ### Modifications Expose inactive topic delete mode in broker.conf, future more we can support namespace level configuration for the inactive topic delete mode. (cherry picked from commit dc7abd8)
### Motivation Currently, pulsar support delete inactive topic which has no active producers and no subscriptions. This pull request is support to delete inactive topics that all subscriptions of the topic are caught up and no active producers/consumer. ### Modifications Expose inactive topic delete mode in broker.conf, future more we can support namespace level configuration for the inactive topic delete mode. (cherry picked from commit dc7abd8)
### Motivation Currently, pulsar support delete inactive topic which has no active producers and no subscriptions. This pull request is support to delete inactive topics that all subscriptions of the topic are caught up and no active producers/consumer. ### Modifications Expose inactive topic delete mode in broker.conf, future more we can support namespace level configuration for the inactive topic delete mode. (cherry picked from commit dc7abd8)
Doc has been added: https://pulsar.apache.org/docs/en/next/reference-configuration/#broker |
### Motivation Currently, pulsar support delete inactive topic which has no active producers and no subscriptions. This pull request is support to delete inactive topics that all subscriptions of the topic are caught up and no active producers/consumer. ### Modifications Expose inactive topic delete mode in broker.conf, future more we can support namespace level configuration for the inactive topic delete mode.
I agree that we not include the condition that consumers have to be inactive. The consumers usually be keep running to provide low latency message processing and so they are always active as much as possible, which will prevent the inactive topic to be cleaned up. |
Motivation
Currently, pulsar support delete inactive topic which has no active producers and no subscriptions. This pull request is support to delete inactive topics that all subscriptions of the topic are caught up and no active producers/consumer.
Modifications
Expose inactive topic delete mode in broker.conf, future more we can support namespace level configuration for the inactive topic delete mode.
Verifying this change
New unit tests added for each inactive topic delete mode.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation