adixitconfluent commented on code in PR #17739: URL: https://github.com/apache/kafka/pull/17739#discussion_r1841166853
########## core/src/main/java/kafka/server/share/SharePartition.java: ########## @@ -1602,8 +1602,6 @@ protected void updateFetchOffsetMetadata(Optional<LogOffsetMetadata> fetchOffset protected Optional<LogOffsetMetadata> fetchOffsetMetadata() { lock.readLock().lock(); try { - if (findNextFetchOffset.get()) Review Comment: @junrao, so, should I do what I suggested https://github.com/apache/kafka/pull/17739#discussion_r1838763754 here, that when the call goes to fetchOffsetMetadata(), we check if `findNextFetchOffset` is true or not, in case it is true, we do a call to nextFetchOffset() which will correctly update the endOffset if it needs to be updated or not. Finally, we just return fetchOffsetMetadata OR for the uncommon case, I update the `fetchOffsetMetadata` to Optional.empty() and remove any dependency on `findNextFetchOffset` -- 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