gharris1727 commented on code in PR #13992:
URL: https://github.com/apache/kafka/pull/13992#discussion_r1259982271


##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceConnector.java:
##########
@@ -321,10 +321,10 @@ void refreshTopicPartitions()
         if (!knownSourceTopicPartitionsSet.equals(sourceTopicPartitionsSet) || 
!missingInTarget.isEmpty()) {
 
             Set<TopicPartition> newTopicPartitions = sourceTopicPartitionsSet;
-            newTopicPartitions.removeAll(knownSourceTopicPartitions);
+            newTopicPartitions.removeAll(knownSourceTopicPartitionsSet);
 
             Set<TopicPartition> deletedTopicPartitions = 
knownSourceTopicPartitionsSet;
-            deletedTopicPartitions.removeAll(sourceTopicPartitions);
+            deletedTopicPartitions.removeAll(sourceTopicPartitionsSet);

Review Comment:
   At this point, the `newTopicPartitions.removeAll` will have mutated the 
`sourceTopicPartitionsSet`, leading this line to miss some removals. I think 
this results in considering topics that exist in both sets to be deleted.



-- 
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