jolshan commented on a change in pull request #9622: URL: https://github.com/apache/kafka/pull/9622#discussion_r544479887
########## File path: core/src/main/scala/kafka/server/MetadataCache.scala ########## @@ -314,9 +315,16 @@ class MetadataCache(brokerId: Int) extends Logging { error(s"Listeners are not identical across brokers: $aliveNodes") } + val newTopicIds = updateMetadataRequest.topicStates().asScala + .map(topicState => (topicState.topicName(), topicState.topicId())) + .filter(_._2 != Uuid.ZERO_UUID).toMap + val topicIds = mutable.Map.empty[String, Uuid] + topicIds.addAll(metadataSnapshot.topicIds) + topicIds.addAll(newTopicIds) Review comment: So it seems like there is some logic to remove the partition states of deleted topics from the MetadataSnapshot. Would we want to do something similar there? Apologies if I'm missing something ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org