JimmyWang6 commented on code in PR #20246:
URL: https://github.com/apache/kafka/pull/20246#discussion_r2449189559
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -835,23 +854,35 @@ public ShareAcquiredRecords acquire(
inFlightBatch, groupId, topicIdPartition);
continue;
}
- // Schedule acquisition lock timeout for the batch.
- AcquisitionLockTimerTask acquisitionLockTimeoutTask =
scheduleAcquisitionLockTimeout(memberId, inFlightBatch.firstOffset(),
inFlightBatch.lastOffset());
- // Set the acquisition lock timeout task for the batch.
-
inFlightBatch.updateAcquisitionLockTimeout(acquisitionLockTimeoutTask);
+ long recordsAcquired = inFlightBatch.lastOffset() -
inFlightBatch.firstOffset() + 1;
+ if (isRecordLimitMode && recordsAcquired >
maxRecordsToAcquire) {
+ AcquiredRecords records =
filterShareAcquiredRecordsInRecordLimitMode(maxRecordsToAcquire,
+ List.of(new AcquiredRecords()
+ .setFirstOffset(inFlightBatch.firstOffset())
+ .setLastOffset(inFlightBatch.lastOffset())
+ .setDeliveryCount((short)
inFlightBatch.batchDeliveryCount())));
Review Comment:
Thanks for the comment. It may not be necessary, since in the
`filterShareAcquiredRecordsInRecordLimitMode `function, the batch-level
acquisition lock timeout will be canceled by
`maybeInitializeOffsetStateUpdate()`, and the offset-level acquisition lock
timeout will be triggered instead.
--
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]