heesung-sn commented on code in PR #21668:
URL: https://github.com/apache/pulsar/pull/21668#discussion_r1414723107


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Producer.java:
##########
@@ -485,6 +485,14 @@ public long getOriginalHighestSequenceId() {
         @Override
         public void completed(Exception exception, long ledgerId, long 
entryId) {
             if (exception != null) {
+                // if the topic is transferring, we don't send error code to 
the clients.
+                if (producer.getTopic().isTransferring()) {
+                    if (log.isDebugEnabled()) {
+                        log.debug("[{}] Received producer exception: {} while 
transferring.",
+                                producer.getTopic().getName(), 
exception.getMessage(), exception);
+                    }
+                    return;
+                }

Review Comment:
   I agree. Moving this logic into the lambda and continue to call the 
cleanups. Thank you.



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1473,6 +1486,9 @@ public CompletableFuture<Void> close(
 
         lock.writeLock().lock();
         try {
+            if (!disconnectClients) {
+                transferring = true;

Review Comment:
   Yes, `transferring` will not go back to false. 
   
   In the worst case, if transferring is stuck, the leader monitor will fix the 
stuck state with `handleOwnEvent` at the `} else if ((data.force() || 
isTransferCommand(data)) && isTargetBroker(data.sourceBroker())) {`. In this 
case, the topics will be forcefully closed with `disconnectClients=true`.



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