chia7712 commented on code in PR #23750:
URL: https://github.com/apache/kafka/pull/23750#discussion_r4425105080


##########
share-coordinator/src/main/java/org/apache/kafka/coordinator/share/ShareCoordinatorShard.java:
##########
@@ -260,11 +260,9 @@ private void handleShareSnapshot(ShareSnapshotKey key, 
ShareSnapshotValue value,
             ShareGroupOffset offsetRecord = ShareGroupOffset.fromRecord(value);
             // This record is the complete snapshot.
             shareStateMap.put(mapKey, offsetRecord);
-            // If number of share updates is exceeded, then reset it.
+            // A snapshot subsumes all prior share updates, so reset the count.
             if (snapshotUpdateCount.containsKey(mapKey)) {

Review Comment:
   The purpose is to reset the count for the key, right? If so, we could just 
remove the key from `snapshotUpdateCount`.
   ```java
   snapshotUpdateCount.remove(mapKey);
   ```



##########
share-coordinator/src/test/java/org/apache/kafka/coordinator/share/ShareCoordinatorShardTest.java:
##########


Review Comment:
   Should we revisit this test? The naming seems to conflict with this PR :)



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