squah-confluent commented on code in PR #22245:
URL: https://github.com/apache/kafka/pull/22245#discussion_r3324704119
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -4091,9 +4276,17 @@ private UpdateTargetAssignmentResult<TasksTuple>
maybeUpdateStreamsTargetAssignm
.withMetadataImage(metadataImage)
.withTargetAssignment(group.targetAssignment());
- updatedMember.ifPresent(member ->
- assignmentResultBuilder.addOrUpdateMember(member.memberId(),
member)
- );
+ updatedMember.ifPresent(member -> {
+ assignmentResultBuilder.addOrUpdateMember(member.memberId(),
member);
+ // If the instance id was associated to a different member, it
means that the
+ // static member is replaced by the current member hence we
remove the previous one.
+ member.instanceId().ifPresent(instanceId -> {
+ StreamsGroupMember previousMember =
group.staticMember(instanceId);
+ if (previousMember != null &&
!member.memberId().equals(previousMember.memberId())) {
+
assignmentResultBuilder.removeMember(previousMember.memberId());
+ }
+ });
+ });
Review Comment:
My mistake, I missed this part. Thanks!
It's fine as is I think.
--
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]