hudeqi commented on code in PR #13719:
URL: https://github.com/apache/kafka/pull/13719#discussion_r1229633097


##########
core/src/main/scala/kafka/server/AbstractFetcherThread.scala:
##########
@@ -680,12 +680,16 @@ abstract class AbstractFetcherThread(name: String,
        */
       val offsetAndEpoch = 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 = Math.max(leaderStartOffset, replicaEndOffset)
       // Only truncate log when current leader's log start offset is greater 
than follower's log end offset.
-      if (leaderStartOffset > replicaEndOffset)
+      if (leaderStartOffset > replicaEndOffset) {
+        warn(s"Truncate fully and start at leader's start offset 
$leaderStartOffset for partition $topicPartition " +
+          s"because the local replica logEndOffset $replicaEndOffset is 
smaller than leader's start offset.")

Review Comment:
   > What do you think about the following wording to be more aligned with the 
other log message?
   > 
   > ```
   > Truncate fully and reset fetch offset for partition $topicPartition from 
$current to the current leader's start offset $new because the local replica's 
end offset is smaller than the current leader's start offsets.
   > ```
   > 
   
   In contrast, the overall meaning is similar, I don't feel a huge difference.



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