jolshan commented on code in PR #14067: URL: https://github.com/apache/kafka/pull/14067#discussion_r1275332469
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/consumer/ConsumerGroup.java: ########## @@ -497,6 +499,30 @@ public DeadlineAndEpoch metadataRefreshDeadline() { return metadataRefreshDeadline; } + /** + * Validates the OffsetCommit request. + * + * @param memberId The member id. + * @param groupInstanceId The group instance id. + * @param memberEpoch The member epoch. + */ + @Override + public void validateOffsetCommit( + String memberId, + String groupInstanceId, + int memberEpoch + ) throws UnknownMemberIdException, StaleMemberEpochException { + // When the member epoch is -1, the request comes from either the admin client + // or a consumer which does not use the group management facility. In this case, + // the request can commit offsets if the group is empty. + if (memberEpoch < 0 && members().isEmpty()) return; Review Comment: I was just curious why isInState(EMPTY) is used in the generic group but not for consumer group, but then I also saw we don't have such a method. 😅 ########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/consumer/ConsumerGroup.java: ########## @@ -497,6 +499,30 @@ public DeadlineAndEpoch metadataRefreshDeadline() { return metadataRefreshDeadline; } + /** + * Validates the OffsetCommit request. + * + * @param memberId The member id. + * @param groupInstanceId The group instance id. + * @param memberEpoch The member epoch. + */ + @Override + public void validateOffsetCommit( + String memberId, + String groupInstanceId, + int memberEpoch + ) throws UnknownMemberIdException, StaleMemberEpochException { + // When the member epoch is -1, the request comes from either the admin client + // or a consumer which does not use the group management facility. In this case, + // the request can commit offsets if the group is empty. + if (memberEpoch < 0 && members().isEmpty()) return; Review Comment: I was just curious why isInState(EMPTY) is used in the generic group but not for consumer group, but then I also saw we don't have such a method. 😅 -- 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