msn-tldr commented on code in PR #14564:
URL: https://github.com/apache/kafka/pull/14564#discussion_r1362521496


##########
clients/src/test/java/org/apache/kafka/clients/MetadataCacheTest.java:
##########
@@ -83,4 +84,69 @@ public void testMissingLeaderEndpoint() {
         assertEquals(nodesById.get(7), replicas.get(7));
     }
 
+    @Test
+    public void testMergeWithThatPreExistingPartitionIsRetainedPostMerge() {

Review Comment:
   test for bug fixed in `MetadataCache`



##########
clients/src/main/java/org/apache/kafka/clients/MetadataCache.java:
##########
@@ -150,7 +150,7 @@ MetadataCache mergeWith(String newClusterId,
         // We want the most recent topic ID. We start with the previous ID 
stored for retained topics and then
         // update with newest information from the MetadataResponse. We always 
take the latest state, removing existing
         // topic IDs if the latest state contains the topic name but not a 
topic ID.
-        Map<String, Uuid> newTopicIds = topicIds.entrySet().stream()
+        Map<String, Uuid> newTopicIds = this.topicIds.entrySet().stream()

Review Comment:
   this was a bug, now has a test in `MetadataCachTest.java`



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