merlimat commented on a change in pull request #1352: Delete inactive
subscriptions automatically
URL: https://github.com/apache/incubator-pulsar/pull/1352#discussion_r179321349
Advertising
##########
File path:
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
##########
@@ -89,6 +89,11 @@
private int messageExpiryCheckIntervalInMinutes = 5;
// How long to delay rewinding cursor and dispatching messages when active
consumer is changed
private int activeConsumerFailoverDelayTimeMillis = 1000;
+ // How long to delete inactive subscriptions from last consuming
+ // When it is 0, inactive subscriptions are not deleted automatically
+ private long subscriptionExpirationTimeMinutes = 0;
+ // How frequently to proactively check and purge expired subscription
+ private long subscriptionExpiryCheckIntervalInMinutes = 5;
Review comment:
In any case, still won't help if the broker gets restarted.
Since the "inactivity" information is not persisted, the new broker will
have to restart the counting from 0.
For example, if `subscriptionExpiration` is 1 week, we might check every
5minutes but we cannot drop it for a week after the cosnumer disconnected.
If the broker gets restarted after 6 days, the new broker will start the
countdown again and the subscription will be stay there for ~2 weeks, or more,
since there's no hard guarantee that this will ever happen.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org
With regards,
Apache Git Services