hachikuji commented on a change in pull request #9689: URL: https://github.com/apache/kafka/pull/9689#discussion_r540311440
########## File path: core/src/main/scala/kafka/server/AbstractFetcherThread.scala ########## @@ -268,11 +271,12 @@ abstract class AbstractFetcherThread(name: String, fetchOffsets.put(tp, offsetTruncationState) case Errors.FENCED_LEADER_EPOCH => - if (onPartitionFenced(tp, latestEpochsForPartitions.get(tp).flatMap { - p => - if (p.currentLeaderEpoch.isPresent) Some(p.currentLeaderEpoch.get()) - else None - })) partitionsWithError += tp + val currentLeaderEpoch = latestEpochsForPartitions.get(tp) match { Review comment: Hmm.. It's a little curious that we need the call to `getLeaderEpoch` here. Tracing this back to `fetchTruncatingPartitions`, it looks like we could not have a negative epoch here. ---------------------------------------------------------------- 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