FreerXY commented on code in PR #12419: URL: https://github.com/apache/kafka/pull/12419#discussion_r923577568
########## connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceConnector.java: ########## @@ -297,10 +291,18 @@ private void syncTopicAcls() private void syncTopicConfigs() throws InterruptedException, ExecutionException { - Map<String, Config> sourceConfigs = describeTopicConfigs(topicsBeingReplicated()); - Map<String, Config> targetConfigs = sourceConfigs.entrySet().stream() - .collect(Collectors.toMap(x -> formatRemoteTopic(x.getKey()), x -> targetConfig(x.getValue()))); - updateTopicConfigs(targetConfigs); + Set<String> topics=this.topicsBeingReplicated(); + Map<String, Config> configDiff=new HashMap<>(); + Map<String, Config> sourceConfigs = describeTopicConfigs(topics,sourceAdminClient).entrySet().stream() + .collect(Collectors.toMap(x -> formatRemoteTopic(x.getKey()), x -> targetConfig(x.getValue()))); + Map<String, Config> targetConfigs = describeTopicConfigs(topics,targetAdminClient).entrySet().stream() + .collect(Collectors.toMap(x -> formatRemoteTopic(x.getKey()), x -> targetConfig(x.getValue()))); + for (String topic:sourceConfigs.keySet()){ + if(targetConfigs.containsKey(topic)&&!targetConfigs.get(topic).equals(sourceConfigs.get(topic))){ + configDiff.put(topic,sourceConfigs.get(topic)); + } + } + updateTopicConfigs(configDiff); Review Comment: //this way is better if (!configDiff.isEmpty()){ updateTopicConfigs(configDiff); } -- 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