jolshan commented on code in PR #14444: URL: https://github.com/apache/kafka/pull/14444#discussion_r1365966459
########## core/src/main/scala/kafka/server/KafkaApis.scala: ########## @@ -619,6 +641,21 @@ class KafkaApis(val requestChannel: RequestChannel, request.header.clientId, topicPartition, status.error.exceptionName)) + + if (request.header.apiVersion >= 10) { + status.currentLeader = { + status.error match { + case Errors.NOT_LEADER_OR_FOLLOWER => + val leaderNode = getCurrentLeader(topicPartition, request.context.listenerName) + nodeEndpoints.put(leaderNode.node.id(), leaderNode.node) + new LeaderIdAndEpoch() + .setLeaderId(leaderNode.leaderId) + .setLeaderEpoch(leaderNode.leaderEpoch) + case _ => + null Review Comment: could this just be the default leaderIdAndEpoch? -- 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