satishd commented on a change in pull request #11390:
URL: https://github.com/apache/kafka/pull/11390#discussion_r814036592



##########
File path: core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
##########
@@ -259,12 +270,12 @@ class ReplicaFetcherThread(name: String,
     val responsePartition = response.topics.asScala.find(_.name == 
topicPartition.topic).get
       .partitions.asScala.find(_.partitionIndex == 
topicPartition.partition).get
 
-     Errors.forCode(responsePartition.errorCode) match {
+    Errors.forCode(responsePartition.errorCode) match {
       case Errors.NONE =>
         if (brokerConfig.interBrokerProtocolVersion >= KAFKA_0_10_1_IV2)
-          responsePartition.offset
+          (responsePartition.leaderEpoch, responsePartition.offset )
         else
-          responsePartition.oldStyleOffsets.get(0)
+          (responsePartition.leaderEpoch, 
responsePartition.oldStyleOffsets.get(0))

Review comment:
       `responsePartition.leaderEpoch` returns -1 with <= KAFKA_0_10_1_IV2 
version. No need to explicitly set it as -1. 




-- 
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


Reply via email to