OmniaGM commented on a change in pull request #11431:
URL: https://github.com/apache/kafka/pull/11431#discussion_r739870251



##########
File path: 
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorMakerConfig.java
##########
@@ -183,12 +187,18 @@ public MirrorClientConfig clientConfig(String cluster) {
 
         // fill in reasonable defaults
         props.putIfAbsent(GROUP_ID_CONFIG, sourceAndTarget.source() + "-mm2");
-        props.putIfAbsent(DistributedConfig.OFFSET_STORAGE_TOPIC_CONFIG, 
"mm2-offsets."
-                + sourceAndTarget.source() + ".internal");
-        props.putIfAbsent(DistributedConfig.STATUS_STORAGE_TOPIC_CONFIG, 
"mm2-status."
-                + sourceAndTarget.source() + ".internal");
-        props.putIfAbsent(DistributedConfig.CONFIG_TOPIC_CONFIG, "mm2-configs."
-                + sourceAndTarget.source() + ".internal");
+
+        String separator = 
originalsStrings().getOrDefault(REPLICATION_POLICY_SEPARATOR, 
REPLICATION_POLICY_SEPARATOR_DEFAULT);
+        if (separator.equals("-")) {
+            throw new ConfigException("You should not use a single dash as a " 
+ REPLICATION_POLICY_SEPARATOR);
+        }
+
+        props.putIfAbsent(DistributedConfig.OFFSET_STORAGE_TOPIC_CONFIG, 
"mm2-offsets" + separator

Review comment:
       > only when MM2 is running in standalone mode.
   
   They are created in any mode if there is no value for 
DistributedConfig.OFFSET_STORAGE_TOPIC_CONFIG
   
   > If the user is running MM2 in connect mode, the user is responsible for 
configuring DistributedConfig.OFFSET_STORAGE_TOPIC_CONFIG, 
DistributedConfig.CONFIG_TOPIC_CONFIG, etc. It is what you are meaning. Right?
   
   Small clarification, users can use `DistributedConfig` with any mode (even 
standalone) to override the name of these topics. 
   And they always had the power to do so, and if the topic name didn't match 
the `isInternalTopic` policy, it would replicate anyway. The main problem I am 
seeing is preventing the unintentional replication of these topics for users 
who use default names for `DistributedConfig`'s topics, for example 
`mm2-offsets.{source}.internal` with other configurations that would make these 
topics not matching `isInternalTopic` any more after upgrading to 3.1 which 
includes KIP-690.




-- 
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-unsubscr...@kafka.apache.org

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


Reply via email to