Yunyung commented on code in PR #19635: URL: https://github.com/apache/kafka/pull/19635#discussion_r2072640806
########## core/src/main/scala/kafka/server/KafkaApis.scala: ########## @@ -429,6 +427,8 @@ class KafkaApis(val requestChannel: RequestChannel, val memoryRecords = partition.records.asInstanceOf[MemoryRecords] if (!authorizedTopics.contains(topicIdPartition.topic)) unauthorizedTopicResponses += topicIdPartition -> new PartitionResponse(Errors.TOPIC_AUTHORIZATION_FAILED) + else if (!metadataCache.contains(topicIdPartition.topicPartition)) + nonExistingTopicResponses += new TopicIdPartition(topicIdPartition.topicId(), topicIdPartition.topicPartition()) -> new PartitionResponse(Errors.UNKNOWN_TOPIC_OR_PARTITION) Review Comment: Thanks for the PR. How about doing this instead? ```suggestion nonExistingTopicResponses += topicIdPartition -> new PartitionResponse(Errors.UNKNOWN_TOPIC_OR_PARTITION) ``` -- 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