adixitconfluent commented on code in PR #17539:
URL: https://github.com/apache/kafka/pull/17539#discussion_r1815592778


##########
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:
   `updateLatestFetchOffsetMetadata()` is only called from `tryComplete` when 
we find that there is a share partition whose offset metadata is not present 
(because in that case only, we call `readFromLog`). However, for any other 
case, we can only update the `latestFetchOffsetMetadata` via `acquire` method 
only. Else we'll have to call `readFromLog` from `tryComplete` in all scenarios 
to directly update share partition's `latestFetchOffsetMetadata`. Anything 
wrong in that understanding?



-- 
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]

Reply via email to