jolshan commented on a change in pull request #9944: URL: https://github.com/apache/kafka/pull/9944#discussion_r660228129
########## File path: clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java ########## @@ -296,11 +276,24 @@ public AbstractResponse getErrorResponse(int throttleTimeMs, Throwable e) { // may not be any partitions at all in the response. For this reason, the top-level error code // is essential for them. Errors error = Errors.forException(e); - LinkedHashMap<TopicPartition, FetchResponseData.PartitionData> responseData = new LinkedHashMap<>(); - for (Map.Entry<TopicPartition, PartitionData> entry : fetchData.entrySet()) { - responseData.put(entry.getKey(), FetchResponse.partitionResponse(entry.getKey().partition(), error)); + List<FetchResponseData.FetchableTopicResponse> topicResponseList = new ArrayList<>(); + // Since UNKNOWN_TOPIC_ID is a new error type only returned when topic ID requests are made (from newer clients), + // we can skip returning the error on all partitions and returning any partitions at all. + if (error != Errors.UNKNOWN_TOPIC_ID) { Review comment: Yeah. I agree it is a bit weird. We can update as you mentioned. -- 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