Chern Yih Cheah created KAFKA-15510:
---------------------------------------
Summary: 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
Reporter: Chern Yih Cheah
Assignee: Chern Yih Cheah
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)