[
https://issues.apache.org/jira/browse/KAFKA-15510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17770051#comment-17770051
]
Rajini Sivaram commented on KAFKA-15510:
----------------------------------------
This does not currently impact truncation in followers, but it seems useful to
fix the regression to avoid breaking in future, if the timing scenario for
truncation changes.
> Follower's lastFetchedEpoch wrongly set when fetch response has no record
> -------------------------------------------------------------------------
>
> Key: KAFKA-15510
> URL: https://issues.apache.org/jira/browse/KAFKA-15510
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 3.6.0, 3.5.1
> Reporter: Chern Yih Cheah
> Assignee: Chern Yih Cheah
> Priority: Major
>
> A regression is introduced by
> [https://github.com/apache/kafka/pull/13843/files#diff-508e9dc4d52744119dda36d69ce63a1901abfd3080ca72fc4554250b7e9f5242.|https://github.com/apache/kafka/pull/13843/files#diff-508e9dc4d52744119dda36d69ce63a1901abfd3080ca72fc4554250b7e9f5242]
> When the fetch response has no record for a partition, validBytes is 0. In
> this case, we shouldn't set the last fetch epoch to
> logAppendInfo.lastLeaderEpoch.asScala since there is no record and it is
> Optional.empty. We should use currentFetchState.lastFetchedEpoch instead.
> An effect of this is truncation of fetch might not work correctly.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)