kamalcph commented on code in PR #15825: URL: https://github.com/apache/kafka/pull/15825#discussion_r1593363337
########## core/src/main/scala/kafka/server/DelayedFetch.scala: ########## @@ -92,7 +92,10 @@ class DelayedFetch( // has just rolled, then the high watermark offset will remain the same but be on the old segment, // which would incorrectly be seen as an instance of Case F. if (endOffset.messageOffset != fetchOffset.messageOffset) { - if (endOffset.onOlderSegment(fetchOffset)) { + if (endOffset.messageOffsetOnly() || fetchOffset.messageOffsetOnly()) { Review Comment: `fetchOffset` can be message-only metadata when there is a diverging-epoch. If there is a diverged-epoch in the LogReadResults, then it won't enter the DelayedFetch. We can remove the check if it is not required. ########## core/src/main/scala/kafka/log/UnifiedLog.scala: ########## @@ -1424,11 +1424,18 @@ class UnifiedLog(@volatile var logStartOffset: Long, /** * Given a message offset, find its corresponding offset metadata in the log. - * If the message offset is out of range, throw an OffsetOutOfRangeException + * 1. If the message offset is lesser than the log-start-offset, then throw an OffsetOutOfRangeException Review Comment: `checkLogStartOffset` will throw `OffsetOutOfRangeException` if the offset is lesser than the `logStartOffset`. -- 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