jolshan commented on a change in pull request #9626: URL: https://github.com/apache/kafka/pull/9626#discussion_r540516535
########## File path: clients/src/main/java/org/apache/kafka/common/requests/LeaderAndIsrRequest.java ########## @@ -138,14 +145,32 @@ public LeaderAndIsrResponse getErrorResponse(int throttleTimeMs, Throwable e) { Errors error = Errors.forException(e); responseData.setErrorCode(error.code()); - List<LeaderAndIsrPartitionError> partitions = new ArrayList<>(); - for (LeaderAndIsrPartitionState partition : partitionStates()) { - partitions.add(new LeaderAndIsrPartitionError() - .setTopicName(partition.topicName()) - .setPartitionIndex(partition.partitionIndex()) - .setErrorCode(error.code())); + if (version() < 5) { Review comment: There is LeaderAndIsrResponseTest.java (which doesn't try all versions) and testGetErrorResponse() in LeaderAndIsrRequestTest.java that does test all versions. I will add version tests to the former. ---------------------------------------------------------------- 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