junrao commented on code in PR #17539:
URL: https://github.com/apache/kafka/pull/17539#discussion_r1815739504
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -542,6 +552,8 @@ public ShareAcquiredRecords acquire(
RecordBatch firstBatch =
fetchPartitionData.records.batches().iterator().next();
lock.writeLock().lock();
try {
+ // Update the latest fetch offset metadata for any future queries.
+ this.latestFetchOffsetMetadata = fetchOffsetMetadata;
Review Comment:
Hmm, to me `acquire` seems to be the wrong place to update
`latestFetchOffsetMetadata`. We update `latestFetchOffsetMetadata` with the
fetch offset and then acquire a few batches after the fetch offset. This
typically moves the next fetch offset, which makes `latestFetchOffsetMetadata`
useless for the next fetch.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]