dajac commented on a change in pull request #10234: URL: https://github.com/apache/kafka/pull/10234#discussion_r586285455
########## File path: clients/src/main/java/org/apache/kafka/common/requests/LeaderAndIsrRequest.java ########## @@ -145,24 +145,21 @@ public LeaderAndIsrResponse getErrorResponse(int throttleTimeMs, Throwable e) { .setErrorCode(error.code())); } responseData.setPartitionErrors(partitions); - return new LeaderAndIsrResponse(responseData, version()); - } - - List<LeaderAndIsrTopicError> topics = new ArrayList<>(data.topicStates().size()); - Map<String, Uuid> topicIds = topicIds(); - for (LeaderAndIsrTopicState topicState : data.topicStates()) { - LeaderAndIsrTopicError topicError = new LeaderAndIsrTopicError(); - topicError.setTopicId(topicIds.get(topicState.topicName())); - List<LeaderAndIsrPartitionError> partitions = new ArrayList<>(topicState.partitionStates().size()); - for (LeaderAndIsrPartitionState partition : topicState.partitionStates()) { - partitions.add(new LeaderAndIsrPartitionError() + } else { + for (LeaderAndIsrTopicState topicState : data.topicStates()) { + List<LeaderAndIsrPartitionError> partitions = new ArrayList<>( + topicState.partitionStates().size()); + for (LeaderAndIsrPartitionState partition : topicState.partitionStates()) { + partitions.add(new LeaderAndIsrPartitionError() .setPartitionIndex(partition.partitionIndex()) Review comment: @chia7712 Starting from version 5, the topic name is no longer in the response: https://github.com/apache/kafka/blob/trunk/clients/src/main/resources/common/message/LeaderAndIsrResponse.json#L46 so we don't set it anymore. Do you really want to add a comment for this? That seems unnecessary to me. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org