michaeljmarshall commented on code in PR #19605:
URL: https://github.com/apache/pulsar/pull/19605#discussion_r1116498630


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##########
@@ -1574,13 +1575,19 @@ private void buildProducerAndAddTopic(Topic topic, long 
producerId, String produ
             if (ex.getCause() instanceof 
BrokerServiceException.TopicMigratedException) {
                 Optional<ClusterUrl> clusterURL = 
getMigratedClusterUrl(service.getPulsar());
                 if (clusterURL.isPresent()) {
-                    log.info("[{}] redirect migrated producer to topic {}: 
producerId={}, {}", remoteAddress, topicName,
-                            producerId, ex.getCause().getMessage());
-                    commandSender.sendTopicMigrated(ResourceType.Producer, 
producerId,
-                            clusterURL.get().getBrokerServiceUrl(), 
clusterURL.get().getBrokerServiceUrlTls());
-                    closeProducer(producer);
-                    return null;
-
+                    if (topic.isReplicationBacklogExist()) {
+                        log.info("Topic {} is migrated but replication backlog 
exist: "
+                                        + "producerId = {}, producerName = {}, 
{}", topicName,
+                                producerId, producerName, 
ex.getCause().getMessage());
+                    } else {
+                        log.info("[{}] redirect migrated producer to topic {}: 
"
+                                        + "producerId={}, producerName = {}, 
{}", remoteAddress,
+                                topicName, producerId, producerName, 
ex.getCause().getMessage());
+                        commandSender.sendTopicMigrated(ResourceType.Producer, 
producerId,

Review Comment:
   I see that we're sending this message without checking the client's protocol 
version. I know that your PR didn't introduce this behavior, but I think we 
should make sure to handle that before this feature is released. Are you able 
to fix this @vineeth1995, or should we open an issue for the work?



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##########
@@ -1540,6 +1540,7 @@ private void buildProducerAndAddTopic(Topic topic, long 
producerId, String produ
                 getPrincipal(), isEncrypted, metadata, schemaVersion, epoch,
                 userProvidedProducerName, producerAccessMode, topicEpoch, 
supportsPartialProducer);
 
+        log.info("trying to add producer - {} to topic -{}", producerName, 
topicName);

Review Comment:
   We already log about this, so I think we can remove this before merging.
   
   
https://github.com/apache/pulsar/blob/8cc979de411f9bca05ea95b16807f1860b79382e/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java#L1374-L1377



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