michaeljmarshall commented on code in PR #19605:
URL: https://github.com/apache/pulsar/pull/19605#discussion_r1117616587
##########
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'm so sorry @vineeth1995, I didn't realize that
`commandSender.sendTopicMigrated` was doing that version check. I think it
makes sense to log the error as you just did, but do we need to consider
sending an unretriable error to the client to make sure they do not constantly
attempt to reconnect?
--
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]