dajac commented on code in PR #23542:
URL: https://github.com/apache/kafka/pull/23542#discussion_r4069502362


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -1804,6 +1804,36 @@ private void 
throwIfInstanceIdIsFenced(StreamsGroupMember member, String groupId
         }
     }
     
+    /**
+     * Validates that the member id received in a join request does not 
already belong to a member
+     * with a different instance id. An instance id may move to a new member 
id when a static member
+     * is replaced but a member id must never acquire a different instance id.
+     *
+     * @param groupId               The group id.
+     * @param receivedMemberId      The member id received in the request.
+     * @param existingInstanceId    The instance id of the existing member 
with the received
+     *                              member id, or null if the existing member 
is a dynamic member.
+     * @param receivedInstanceId    The instance id received in the request.
+     *
+     * @throws InvalidRequestException if the received instance id differs 
from the instance id
+     *                                 of the existing member.
+     */
+    private void throwIfMemberIdHasDifferentInstanceId(
+        String groupId,
+        String receivedMemberId,
+        String existingInstanceId,
+        String receivedInstanceId
+    ) {
+        if (!receivedInstanceId.equals(existingInstanceId)) {

Review Comment:
   I will consider it separately.



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