nileshkumar3 commented on code in PR #22356:
URL: https://github.com/apache/kafka/pull/22356#discussion_r3303326371
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -1564,6 +1564,37 @@ private void throwIfConsumerGroupIsFull(
}
}
+ /**
+ * Checks whether the consumer group can accept a new member or not based
on the
+ * max group size defined.
+ *
+ * @param group The consumer group.
+ * @param memberId The member id.
+ * @param instanceId The instance Id.
+ *
+ * @throws GroupMaxSizeReachedException if the maximum capacity has been
reached.
+ */
+ private void throwIfConsumerGroupIsFull(
+ ConsumerGroup group,
+ String memberId,
+ String instanceId
+ ) throws GroupMaxSizeReachedException {
+ // If a static member already exists, we do not enforce the maximum
group size check.
+ // An existing static member will fall into one of the following two
cases,
+ // and neither affects the group size:
+ // 1. The member is replaced due to the static member rejoining.
+ // 2. 'UnreleasedInstanceIdException' is raised due to an epoch
mismatch.
+ if (instanceId != null && group.hasStaticMember(instanceId))
Review Comment:
nit: group.hasStaticMember already return false when instanceId is null.
null check is redundant.
--
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]