You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/08/29 14:27:55 UTC

[GitHub] [pulsar] codelipenghui commented on a diff in pull request #16622: Skip topics with remote replication producers in topic inactivity check

codelipenghui commented on code in PR #16622:
URL: https://github.com/apache/pulsar/pull/16622#discussion_r957410170


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -2195,6 +2195,15 @@ public void checkGC() {
             CompletableFuture<Void> replCloseFuture = new CompletableFuture<>();
 
             if (TopicName.get(topic).isGlobal()) {
+                // topics with remote (replication) producer should be skipped
+                if (hasRemoteProducers()) {
+                    if (log.isDebugEnabled()) {
+                        log.debug("[{}] Global topic has connected remote producers. Not a candidate for GC",
+                                topic);
+                    }
+                    return;
+                }
+
                 // For global namespace, close repl producers first.
                 // Once all repl producers are closed, we can delete the topic,
                 // provided no remote producers connected to the broker.

Review Comment:
   +1
   
   I also have the same concern
   
   And do we have a test for covering the inactive geo topic deletion? 
   The CI gets passed.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org