You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "dajac (via GitHub)" <gi...@apache.org> on 2023/06/14 12:43:49 UTC

[GitHub] [kafka] dajac commented on a diff in pull request #13719: MINOR:Fix illogical log in fetchOffsetAndTruncate method

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


##########
core/src/main/scala/kafka/server/AbstractFetcherThread.scala:
##########
@@ -680,12 +680,15 @@ 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)
+      info(s"Reset fetch offset for partition $topicPartition from $replicaEndOffset to " +

Review Comment:
   I see. In this case, would it make sense to move this log to the else branch of the if at L687? It is a bit weird to log this and then potentially the warning.
   
   If we do this, we could also rewrite it as follow:
   ```
   Reset fetch offset for partition $topicPartition from $replicaEndOffset to the current local replica's end offset $offsetToFetch
   ```
   
   Would this make sense?



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org