jolshan commented on code in PR #15023:
URL: https://github.com/apache/kafka/pull/15023#discussion_r1430474440


##########
clients/src/main/java/org/apache/kafka/clients/Metadata.java:
##########
@@ -427,10 +427,15 @@ public synchronized Set<TopicPartition> 
updatePartitionLeadership(Map<TopicParti
             );
         }
 
-        this.cache = cache.mergeWith(cache.clusterResource().clusterId(), 
newNodes,
-                    updatePartitionMetadata, Collections.emptySet(), 
Collections.emptySet(),
-                    Collections.emptySet(), cache.cluster().controller(), 
topicIdsForUpdatedTopics,
-                    (topic, isInternal) -> !updatedTopics.contains(topic));
+        // Always merge the updated partitions with the existing topic metadata

Review Comment:
   nit: Can we maybe include a note about the desired behavior -- FETCH 
requests can include some partition changes, and when we keep existing topic 
metadata, we take the new partition changes but keep all partitions that 
weren't changed?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to