frankvicky commented on code in PR #17549: URL: https://github.com/apache/kafka/pull/17549#discussion_r1819213379
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java: ########## @@ -1293,21 +1294,28 @@ private void throwIfNull( * Validates the request. * * @param request The request to validate. - * + * @param apiVersion The version of ConsumerGroupHeartbeat RPC * @throws InvalidRequestException if the request is not valid. * @throws UnsupportedAssignorException if the assignor is not supported. */ private void throwIfConsumerGroupHeartbeatRequestIsInvalid( - ConsumerGroupHeartbeatRequestData request + ConsumerGroupHeartbeatRequestData request, + short apiVersion ) throws InvalidRequestException, UnsupportedAssignorException { + if (apiVersion >= CONSUMER_GENERATED_MEMBER_ID_REQUIRED_VERSION || + request.memberEpoch() > 0 || + request.memberEpoch() == LEAVE_GROUP_MEMBER_EPOCH + ) { + throwIfNull(request.memberId(), "MemberId can't be null."); Review Comment: Yes, you're right. There is no `nullableVersions` and `"default: null"` for `memberId`. I will remove this null check. -- 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