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


##########
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:
   Hi @junrao , I understand your point now. Here's my proposed solution 
changes- 
   1. Remove update of `latestFetchOffsetMetadata` via `acquire` method
   2. In `onComplete`, after I complete the call of 
`ShareFetchUtils.processFetchResponse`(which internally completes the call of 
`acquire` method), I will do a `readFromLog` for `topicPartitionData` with 
their latest fetch offset and update the share partition's 
`latestFetchOffsetMetadata`. Note this call to `readFromLog` will always happen 
despite the `tryComplete` `readFromLog` happens or not.
   
   Please let me know what you think of this approach.
   



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