hanmz commented on code in PR #21203:
URL: https://github.com/apache/pulsar/pull/21203#discussion_r1330927120


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1826,7 +1826,10 @@ CompletableFuture<Void> removeReplicator(String 
remoteCluster) {
             ledger.asyncDeleteCursor(name, new DeleteCursorCallback() {
                 @Override
                 public void deleteCursorComplete(Object ctx) {
-                    replicators.remove(remoteCluster);
+                    Replicator replicator = replicators.remove(remoteCluster);
+                    if (replicator != null) {
+                        replicator.close();

Review Comment:
   The method replicator.startProducer may be called again after the method 
replicator.disconnect is called when reopen the topic.
   
   I think this is more reasonable. Use the method replicator.close instead of 
replicator.disconnect when remove replicator in the class PersistentTopic, set 
the stat to closed and call the method replicator.disconnect  in the method 
replicator.close.
   
   The main problem currently is that there is no clear mark indicating that 
the replicator is closed (this closed state will not be opened again)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to