chickenchickenlove commented on code in PR #22245:
URL: https://github.com/apache/kafka/pull/22245#discussion_r3274050966
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -1718,17 +1759,41 @@ private void
throwIfStaticMemberIsUnknown(ConsumerGroupMember staticMember, Stri
}
}
+ /**
+ * Validates whether a static member exists for the given instanceId.
+ *
+ * @param staticMember The static member in the group.
+ * @param receivedInstanceId The instance id received in the request.
+ *
+ * @throws UnknownMemberIdException if no static member exists in the
group against the provided instance id.
+ */
+ private void throwIfStaticMemberIsUnknown(StreamsGroupMember staticMember,
String receivedInstanceId) {
+ if (staticMember == null) {
+ throw Errors.UNKNOWN_MEMBER_ID.exception("Instance id " +
receivedInstanceId + " is unknown.");
+ }
+ }
+
/**
* Checks whether the streams group can accept a new member or not based
on the
* max group size defined.
*
* @param group The streams group.
+ * @param instanceId The instance id.
*
* @throws GroupMaxSizeReachedException if the maximum capacity has been
reached.
*/
private void throwIfStreamsGroupIsFull(
Review Comment:
I think `throwIfConsumerGroupIsFull(...)` has potential bug. I filled the
ticket KAFKA-20601.
Also, I’ll update throwIfStreamsGroupIsFull() to use both the member ID and
the instance ID!
--
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]