apoorvmittal10 commented on code in PR #20973:
URL: https://github.com/apache/kafka/pull/20973#discussion_r2564818013


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareAcquireMode.java:
##########
@@ -65,7 +65,7 @@ public static ShareAcquireMode forId(byte id) {
 
     @Override
     public String toString() {
-        return "ShareAcquireMode(" + name + " (" + id + "))";
+        return name;

Review Comment:
   Just for my knowledge: Why this change?



##########
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:
   I do not see any tests changes so are we testing the metrics in record limit 
mode, if we would be then we should have caught the issue earlier?



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