sijie commented on a change in pull request #6077: Support delete inactive 
topic when subscriptions caught up
URL: https://github.com/apache/pulsar/pull/6077#discussion_r367988673
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
 ##########
 @@ -1586,19 +1594,34 @@ public long getBacklogSize() {
         return ledger.getEstimatedBacklogSize();
     }
 
-    public boolean isActive() {
+    public boolean isActive(InactiveTopicDeleteMode deleteMode) {
+        switch (deleteMode) {
+            case delete_when_no_subscriptions:
+                if (!subscriptions.isEmpty()) {
+                    return true;
+                }
+            case delete_when_subscriptions_caught_up:
+                if (hasLocalConsumers() || hasBacklogs()) {
 
 Review comment:
   I think in `delete_when_subscriptions_caught_up` mode, we just need to check 
if the backlog is empty or not. we don't need to check if there are consumers 
connected. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to