jolshan commented on a change in pull request #10952: URL: https://github.com/apache/kafka/pull/10952#discussion_r670553966
########## File path: clients/src/main/java/org/apache/kafka/clients/Metadata.java ########## @@ -316,20 +325,29 @@ private MetadataCache handleMetadataResponse(MetadataResponse metadataResponse, Set<String> invalidTopics = new HashSet<>(); List<MetadataResponse.PartitionMetadata> partitions = new ArrayList<>(); + Map<String, Uuid> topicIds = new HashMap<>(); for (MetadataResponse.TopicMetadata metadata : metadataResponse.topicMetadata()) { - topics.add(metadata.topic()); + String topicName = metadata.topic(); + Uuid topicId = metadata.topicId(); + topics.add(topicName); + // We only update if the current metadata since we can only compare when both topics have valid IDs + Uuid oldTopicId = null; + if (!topicId.equals(Uuid.ZERO_UUID)) { Review comment: Yeah. There can not be a null uuid in the request. but I can rephrase -- 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