chickenchickenlove commented on code in PR #21565:
URL: https://github.com/apache/kafka/pull/21565#discussion_r2871157107


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroup.java:
##########
@@ -500,6 +500,20 @@ public Map<String, String> staticMembers() {
         return Collections.unmodifiableMap(staticMembers);
     }
 
+    /**
+     * @return Returns whether the given instance ID is currently associated 
with an existing static member.
+     */
+    public boolean staticMemberExist(String instanceId) {
+        String memberId = staticMembers.get(instanceId);
+        if (memberId == null) 
+            return false;
+        
+        StreamsGroupMember member = members.get(memberId);
+        if (member == null)
+            return false;
+        return true;
+    }
+

Review Comment:
   @squah-confluent 
   It makes sense to me! 
   
   This method was added to prevent an unintended` 
GroupMaxSizeReachedException` from being thrown when a static member joins 
within `throwsIfStreamsGroupsIsFull`.
   
   Unlike `ConsumerGroup`, `StreamsGroup` manages `members` and `staticMembers` 
separately. However, given the purpose above, it does not seem necessary to 
verify whether there is an actual `member` currently bound to the `static 
member`.
   
   Even if we assume a case where a `static member` exists but no corresponding 
`member` exists, the impact on `GroupMaxSizeReachedException` remains unchanged.



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