chb2ab commented on code in PR #14444:
URL: https://github.com/apache/kafka/pull/14444#discussion_r1367112293
##########
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:
yeah, looking again the currentLeader should already be set to the default,
I removed the allocation
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]