smjn commented on code in PR #24106:
URL: https://github.com/apache/kafka/pull/24106#discussion_r4513483159


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -5910,7 +5898,13 @@ public CoordinatorResult<Void, CoordinatorRecord> 
initializeShareGroupState(
         if (topicPartitionMap == null || topicPartitionMap.isEmpty()) {
             return new CoordinatorResult<>(List.of(), null);
         }
-        ShareGroup group = (ShareGroup) groups.get(groupId);
+        ShareGroup group;
+        try {
+            group = shareGroup(groupId);
+        } catch (GroupIdNotFoundException ex) {
+            log.debug("[GroupId {}] Could not initialize the share group 
state: {}", groupId, ex.getMessage());

Review Comment:
   nit: should be a warn log - the scenario being addressed is a rare race - 
while a share groups offsets are being initialized on the persister, all 
members leave and the group is deleted and then the persister call comes back 
successfully and above code executes resulting in a no-op. Previous code 
throwing exception while unintentional was showing a sign this happened. New 
code hides this completely.



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