rdhabalia commented on code in PR #19605:
URL: https://github.com/apache/pulsar/pull/19605#discussion_r1144077244
##########
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:
we can also add broker-side feature to restrict specific client versions to
activate this functionality as such a feature requires all clients to upgrade
the version. but that can be addressed into a separate PR.
--
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]