bozhao12 commented on code in PR #12078:
URL: https://github.com/apache/kafka/pull/12078#discussion_r867291272


##########
core/src/main/scala/kafka/server/DelayedFetch.scala:
##########
@@ -148,8 +148,8 @@ class DelayedFetch(delayMs: Long,
             debug(s"Partition $topicIdPartition is in an offline log 
directory, satisfy $fetchMetadata immediately")
             return forceComplete()
           case _: FencedLeaderEpochException => // Case E
-            debug(s"Broker is the leader of partition $topicIdPartition, but 
the requested epoch " +
-              s"$fetchLeaderEpoch is fenced by the latest leader epoch, 
satisfy $fetchMetadata immediately")
+            debug(s"The requested epoch $fetchLeaderEpoch of partition 
$topicIdPartition" +

Review Comment:
   @jolshan Thanks for your review, I read this part of the code again and I 
think this case exists.
   For example:
   A partition P0 (1,2,3) with three replicas. 1 is the leader, 2,3 are the 
followers, the leader epoch is 10, and the consumer fetches data from follower 
replica 3.
   At this time, the leader changes, 2 becomes the leader, the leader epoch 
becomes 11,  Follower replica 3 receives LeaderAndIsrRequest and executes the 
makeFollower operation and  updates the leaderEpoch to 11.
   If the consumer still uses leader epoch 10 to fetch data from replica 3. it 
will throw FenchedLeaderEpochException.



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