apoorvmittal10 commented on code in PR #20395: URL: https://github.com/apache/kafka/pull/20395#discussion_r2298978186
########## core/src/main/java/kafka/server/share/SharePartition.java: ########## @@ -1512,6 +1566,13 @@ private ShareAcquiredRecords acquireNewBatchRecords( // which falls under the max messages limit. As the max fetch records is the soft // limit, the last offset can be higher than the max messages. lastAcquiredOffset = lastOffsetFromBatchWithRequestOffset(batches, firstAcquiredOffset + maxFetchRecords - 1); + // If the initial read gap offset window is active then it's not guaranteed that the + // batches align on batch boundaries. Hence, reset to last offset itself if the batch's + // last offset is greater than the last offset for acquisition, else there could be + // a situation where the batch overlaps with the initial read gap offset window batch. Review Comment: Good sugestion, done. -- 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