dajac commented on code in PR #15546: URL: https://github.com/apache/kafka/pull/15546#discussion_r1529919197
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java: ########## @@ -598,15 +600,16 @@ public List<DescribeGroupsResponseData.DescribedGroup> describeGroups( */ ConsumerGroup getOrMaybeCreateConsumerGroup( String groupId, - boolean createIfNotExists + boolean createIfNotExists, + List<Record> records ) throws GroupIdNotFoundException { Group group = groups.get(groupId); if (group == null && !createIfNotExists) { throw new GroupIdNotFoundException(String.format("Consumer group %s not found.", groupId)); } - if (group == null) { + if (group == null || maybeDeleteEmptyClassicGroup(group, records)) { Review Comment: Should we only consider deleting the previous empty group only if `createIfNotExists` is `true`? It is perhaps not necessary. What do you think? ########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java: ########## @@ -619,6 +622,16 @@ ConsumerGroup getOrMaybeCreateConsumerGroup( } } + /** + * An overloaded method of {@link GroupMetadataManager#getOrMaybeCreateConsumerGroup(String, boolean, List<Record>)} + */ + ConsumerGroup getOrMaybeCreateConsumerGroup( Review Comment: It looks like that this one is always used with `createIfNotExists` set to `false`. Should we remove the flag and rename the 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