nodece commented on code in PR #21679: URL: https://github.com/apache/pulsar/pull/21679#discussion_r1428823895
########## pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java: ########## @@ -1419,4 +1424,40 @@ public static Optional<ClusterUrl> getMigratedClusterUrl(PulsarService pulsar, S } return Optional.empty(); } + + private CompletableFuture<Void> catchCreateTopicForRemoteCluster(CompletableFuture<Void> createTopicFuture) { + return createTopicFuture.exceptionally(ex -> { + Throwable throwable = FutureUtil.unwrapCompletionException(ex); + if (throwable instanceof ConflictException) { + int code = ((ConflictException) throwable).getStatusCode(); + if (code == Status.CONFLICT.getStatusCode()) { Review Comment: > Maybe all the partitioned-topic tries to create topic for the remote cluster, so there will throw `Conflict` exception, right? Rright. If `Conflict` is thrown, it indicates that the topic already exists in the remote cluster. -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org