jolshan commented on a change in pull request #9626: URL: https://github.com/apache/kafka/pull/9626#discussion_r540513762
########## File path: core/src/main/scala/kafka/controller/KafkaController.scala ########## @@ -1378,12 +1378,26 @@ class KafkaController(val config: KafkaConfig, val offlineReplicas = new ArrayBuffer[TopicPartition]() val onlineReplicas = new ArrayBuffer[TopicPartition]() - leaderAndIsrResponse.partitions.forEach { partition => - val tp = new TopicPartition(partition.topicName, partition.partitionIndex) - if (partition.errorCode == Errors.KAFKA_STORAGE_ERROR.code) - offlineReplicas += tp - else if (partition.errorCode == Errors.NONE.code) - onlineReplicas += tp + if (leaderAndIsrResponse.topics().isEmpty) { Review comment: Yeah. One option I thought of would be to do something like partitions(Map<id, string> topicNames) and handle it inside the response with the version. That might be a little cleaner but I'm not sure. ---------------------------------------------------------------- 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