JimmyWang6 commented on code in PR #20246:
URL: https://github.com/apache/kafka/pull/20246#discussion_r2480015999
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -816,8 +821,9 @@ public ShareAcquiredRecords acquire(
// Compute if the batch is a full match.
boolean fullMatch = checkForFullMatch(inFlightBatch,
firstBatch.baseOffset(), lastOffsetToAcquire);
-
- if (!fullMatch || inFlightBatch.offsetState() != null) {
+ long numRecordsToAcquire = inFlightBatch.lastOffset() -
inFlightBatch.firstOffset() + 1;
+ int numRecordsRemaining = maxRecordsToAcquire - acquiredCount;
+ if (!fullMatch || inFlightBatch.offsetState() != null ||
(isRecordLimitMode && (numRecordsToAcquire > numRecordsRemaining))) {
Review Comment:
Good idea. Modified as follows::
```java
boolean recordLimitSubsetMatch = isRecordLimitMode &&
checkForRecordLimitSubsetMatch(inFlightBatch, maxRecordsToAcquire,
acquiredCount);
```
--
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]