vamossagar12 commented on code in PR #14432: URL: https://github.com/apache/kafka/pull/14432#discussion_r1405737202
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/consumer/TargetAssignmentBuilder.java: ########## @@ -223,20 +238,30 @@ public TargetAssignmentResult build() throws PartitionAssignorException { Map<String, AssignmentMemberSpec> memberSpecs = new HashMap<>(); // Prepare the member spec for all members. - members.forEach((memberId, member) -> memberSpecs.put(memberId, createAssignmentMemberSpec( - member, - targetAssignment.getOrDefault(memberId, Assignment.EMPTY), - subscriptionMetadata - ))); + members.forEach((memberId, member) -> { + memberSpecs.put(memberId, createAssignmentMemberSpec( + member, + targetAssignment.getOrDefault(memberId, Assignment.EMPTY), + subscriptionMetadata + )); + }); // Update the member spec if updated or deleted members. updatedMembers.forEach((memberId, updatedMemberOrNull) -> { if (updatedMemberOrNull == null) { memberSpecs.remove(memberId); } else { + ConsumerGroupMember member = members.get(memberId); + Assignment assignment; + // A new static member joins and needs to replace an existing departed one. + if (member == null && staticMembers.containsKey(updatedMemberOrNull.instanceId())) { + assignment = targetAssignment.getOrDefault(staticMembers.get(updatedMemberOrNull.instanceId()), Assignment.EMPTY); Review Comment: Yes, your understanding is correct. I see what you are saying about how this won't work when a new static member joins. I have updated the group to expose the current set of static members in the group. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org