lorcanj commented on code in PR #19199: URL: https://github.com/apache/kafka/pull/19199#discussion_r2004905258
########## clients/src/main/java/org/apache/kafka/clients/Metadata.java: ########## @@ -422,21 +423,17 @@ public synchronized Set<TopicPartition> updatePartitionLeadership(Map<TopicParti updatePartitionMetadata.add(updatedMetadata); lastSeenLeaderEpochs.put(partition, newLeader.epoch.get()); + + final String updatedTopic = updatedMetadata.topic(); + if (this.metadataSnapshot.topicIds().containsKey(updatedTopic)) + topicIdsForUpdatedTopics.put(updatedTopic, this.metadataSnapshot.topicIds().get(updatedTopic)); Review Comment: Makes sense to me. I think a similar approach can be taken in MetadataSnapshot in the lines below `if (this.topicIds.containsKey(entry.getKey().topic()))` ` newTopicIds.putIfAbsent(entry.getKey().topic(), this.topicIds.get(entry.getKey().topic()));` -- 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