JimmyWang6 commented on code in PR #20973:
URL: https://github.com/apache/kafka/pull/20973#discussion_r2565380088
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -1827,13 +1827,13 @@ private List<AcquiredRecords> createBatches(
sharePartitionMetrics);
int delayMs =
recordLockDurationMsOrDefault(groupConfigManager, groupId,
defaultRecordLockDurationMs);
long lastOffset = acquiredRecords.firstOffset() +
maxFetchRecords - 1;
- acquiredRecords.setLastOffset(lastOffset);
inFlightBatch.maybeInitializeOffsetStateUpdate(lastOffset,
delayMs);
updateFindNextFetchOffset(true);
cachedState.put(acquiredRecords.firstOffset(),
inFlightBatch);
sharePartitionMetrics.recordInFlightBatchMessageCount(
acquiredRecords.lastOffset() -
acquiredRecords.firstOffset() + 1);
+ acquiredRecords.setLastOffset(lastOffset);
return List.of(acquiredRecords);
Review Comment:
Besides this, the current `inFlightBatchMessageCount` records only
batch-level `inFlightMessageCount` and may not accurately reflect per-offset
counts; perhaps we should add an offset-level metric. What do you think?
--
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]