jolshan commented on a change in pull request #9944: URL: https://github.com/apache/kafka/pull/9944#discussion_r660199209
########## File path: clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java ########## @@ -277,14 +277,18 @@ public AbstractResponse getErrorResponse(int throttleTimeMs, Throwable e) { // is essential for them. Errors error = Errors.forException(e); List<FetchResponseData.FetchableTopicResponse> topicResponseList = new ArrayList<>(); - data.topics().forEach(topic -> { - List<FetchResponseData.PartitionData> partitionResponses = topic.partitions().stream().map(partition -> - FetchResponse.partitionResponse(partition.partition(), error)).collect(Collectors.toList()); - topicResponseList.add(new FetchResponseData.FetchableTopicResponse() - .setTopic(topic.topic()) - .setTopicId(topic.topicId()) - .setPartitions(partitionResponses)); - }); + // Since UNKNOWN_TOPIC_ID is a new error type only returned when topic ID requests are made (from newer clients), Review comment: We need to do something like this to easily get the top level error with no partition response for UNKNOWN_TOPIC_ID. I think this works, but we may want a version check as well just to be safe. -- 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