squah-confluent commented on code in PR #18224: URL: https://github.com/apache/kafka/pull/18224#discussion_r1909868558
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java: ########## @@ -984,27 +984,36 @@ private boolean validateOnlineDowngradeWithReplacedMemberId( * Creates a ClassicGroup corresponding to the given ConsumerGroup. * * @param consumerGroup The converted ConsumerGroup. - * @param leavingMemberId The leaving member that triggers the downgrade validation. + * @param leavingMemberIds The leaving member(s) that triggered the downgrade validation. * @param joiningMember The newly joined member if the downgrade is triggered by static member replacement. + * When not null, leavingMemberIds must contain the single member being replaced. * @param records The record list to which the conversion records are added. */ private void convertToClassicGroup( ConsumerGroup consumerGroup, - String leavingMemberId, + Set<String> leavingMemberIds, ConsumerGroupMember joiningMember, List<CoordinatorRecord> records ) { + if (joiningMember != null && leavingMemberIds.size() != 1) { + throw new IllegalArgumentException( + String.format("joiningMember is not null, but leavingMemberIds contains %d members.", leavingMemberIds.size()) + ); + } Review Comment: I gave that a try. Let me know what you 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org