You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/08/05 13:41:17 UTC

[GitHub] [kafka] mimaison commented on a change in pull request #10277: KAFKA-9914: Fix replication cycle detection

mimaison commented on a change in pull request #10277:
URL: https://github.com/apache/kafka/pull/10277#discussion_r683463480



##########
File path: connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceConnector.java
##########
@@ -489,7 +489,17 @@ boolean isCycle(String topic) {
         String source = replicationPolicy.topicSource(topic);
         if (source == null) {
             return false;
-        } else if (source.equals(sourceAndTarget.target())) {
+        }
+
+        // Fix for https://issues.apache.org/jira/browse/KAFKA-9914
+        final boolean condition;
+        if (replicationPolicy instanceof IdentityReplicationPolicy) {

Review comment:
       This seems a bit brittle. Users could implement their own `ReplicationPolicy` that behaves like `IdentityReplicationPolicy` and this would not catch it. Can we detect what to do by making calls on the `replicationPolicy` instead?




-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org