jolshan commented on a change in pull request #10952: URL: https://github.com/apache/kafka/pull/10952#discussion_r670558097
########## File path: clients/src/main/java/org/apache/kafka/clients/MetadataCache.java ########## @@ -130,13 +150,36 @@ MetadataCache mergeWith(String newClusterId, Set<String> addInvalidTopics, Set<String> addInternalTopics, Node newController, + Map<String, Uuid> topicIds, BiPredicate<String, Boolean> retainTopic) { Predicate<String> shouldRetainTopic = topic -> retainTopic.test(topic, internalTopics.contains(topic)); Map<TopicPartition, PartitionMetadata> newMetadataByPartition = new HashMap<>(addPartitions.size()); + Map<String, Uuid> newTopicIds = new HashMap<>(topicIds.size()); + + // We want the most recent topic ID. We start with the previous ID stored for retained topics and then + // update with newest information in the MetadataResponse. + // If the newest MetadataResponse: + // - contains a new topic with no ID, add no IDs to newTopicIds Review comment: sure. that's easier to understand I think. -- 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