You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "tvainika (via GitHub)" <gi...@apache.org> on 2026/04/17 07:35:08 UTC
[PR] KAFKA-9914: Fix replication cycle detection [kafka]
tvainika opened a new pull request, #22079:
URL: https://github.com/apache/kafka/pull/22079
Fix replication cycle detection to detect recursive topic cycles if kafka cluster naming differs between multiple MM2 instances with special handling for IdentityReplicationPolicy.
This fixes KAFKA-9914
This PR is resubmission of #10277 which got stuck in review process.
--
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
Re: [PR] KAFKA-9914: Fix replication cycle detection [kafka]
Posted by "viktorsomogyi (via GitHub)" <gi...@apache.org>.
viktorsomogyi commented on PR #22079:
URL: https://github.com/apache/kafka/pull/22079#issuecomment-4288301835
@tvainika merged this one, thanks for your contribution!
--
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
Re: [PR] KAFKA-9914: Fix replication cycle detection [kafka]
Posted by "viktorsomogyi (via GitHub)" <gi...@apache.org>.
viktorsomogyi commented on code in PR #22079:
URL: https://github.com/apache/kafka/pull/22079#discussion_r3110841967
##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceConnector.java:
##########
@@ -720,7 +720,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:
One thought I have is that should we even bring `IdentityReplicationPolicy` into this fix? Its documentation states that there will be no cycle checks, so I think we shouldn't do any to respect the class's documentation.
This way we could also simplify this even more and get rid of `condition`.
--
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
Re: [PR] KAFKA-9914: Fix replication cycle detection [kafka]
Posted by "tvainika (via GitHub)" <gi...@apache.org>.
tvainika commented on code in PR #22079:
URL: https://github.com/apache/kafka/pull/22079#discussion_r3115496381
##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceConnector.java:
##########
@@ -720,7 +720,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:
With code written like this the behaviour is exactly like before for `IdentityReplicationPolicy`. Basically this means that if source cluster alias is configured to equal with target cluster alias can `isCycle` return `true` with `IdentityReplicationPolicy`. It is very odd way of configuration, or misconfiguration, but it was preserved while writing the patch for safety.
--
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
Re: [PR] KAFKA-9914: Fix replication cycle detection [kafka]
Posted by "viktorsomogyi (via GitHub)" <gi...@apache.org>.
viktorsomogyi merged PR #22079:
URL: https://github.com/apache/kafka/pull/22079
--
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