Hangleton commented on code in PR #13268:
URL: https://github.com/apache/kafka/pull/13268#discussion_r1112735419


##########
core/src/main/scala/kafka/server/AbstractFetcherThread.scala:
##########
@@ -704,18 +708,18 @@ abstract class AbstractFetcherThread(name: String,
        * Putting the two cases together, the follower should fetch from the 
higher one of its replica log end offset
        * and the current leader's (local-log-start-offset or) log start offset.
        */
-      val (epoch, leaderStartOffset) = if (fetchFromLocalLogStartOffset)
+      val offsetAndEpoch = if (fetchFromLocalLogStartOffset)
         leader.fetchEarliestLocalOffset(topicPartition, currentLeaderEpoch) 
else
         leader.fetchEarliestOffset(topicPartition, currentLeaderEpoch)
-
+      val leaderStartOffset = offsetAndEpoch.offset
       warn(s"Reset fetch offset for partition $topicPartition from 
$replicaEndOffset to current " +
         s"leader's start offset $leaderStartOffset")
       val offsetToFetch =
         if (leaderStartOffset > replicaEndOffset) {
           // Only truncate log when current leader's log start offset (local 
log start offset if >= 3.4 version incaseof
           // OffsetMovedToTieredStorage error) is greater than follower's log 
end offset.
           // truncateAndBuild returns offset value from which it needs to 
start fetching.
-          truncateAndBuild(epoch, leaderStartOffset)
+          truncateAndBuild(offsetAndEpoch.leaderEpoch, leaderStartOffset)

Review Comment:
   Minor - maybe the argument of `truncateAndBuild` could be the 
`offsetAndEpoch` itself?



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