urbandan commented on code in PR #13975: URL: https://github.com/apache/kafka/pull/13975#discussion_r1258090035
########## 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: I think that the BROKER_NOT_AVAILABLE should be a top level error for the metadata API - e.g. for a metadata request, it doesn't seem correct to report it per-partition, when in reality, the broker itself cannot properly serve the request at all (it doesn't even know anything about the topics listed in the request) -- 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