viktorsomogyi commented on code in PR #13975: URL: https://github.com/apache/kafka/pull/13975#discussion_r1261378645
########## core/src/main/scala/kafka/server/metadata/KRaftMetadataCache.scala: ########## @@ -174,14 +174,25 @@ class KRaftMetadataCache(val brokerId: Int) extends MetadataCache with Logging w errorUnavailableEndpoints: Boolean = false, errorUnavailableListeners: Boolean = false): Seq[MetadataResponseTopic] = { val image = _currentImage - topics.toSeq.flatMap { topic => - getPartitionMetadata(image, topic, listenerName, errorUnavailableEndpoints, errorUnavailableListeners).map { partitionMetadata => + if (!isInitialized()) { + topics.toSeq.map(topic => Review Comment: In case of Zookeeper-Kafka I think this would be a good solution. With KRaft it seems though that it already returns `UNKNOWN_TOPIC_OR_PARTITION` error so the fix may not needed there. I'll do some more digging tomorrow. -- 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