dajac commented on code in PR #24386:
URL: https://github.com/apache/kafka/pull/24386#discussion_r4698130124


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########


Review Comment:
   Agreed, this PR only addresses the first aspect. For the second one, every 
exit of `classicGroupJoinToClassicGroup` should return the records collected so 
far: the early return in the `GroupIdNotFoundException` catch and `return 
result;`. With this PR, neither return can be reached with tombstones, so it is 
hardening and I'd do it in a follow-up. `return result;` needs some care: a 
`CoordinatorResult` replays all its records or none, so the tombstones can't 
simply be added to a result that replays its records.
   



##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -7834,10 +7837,15 @@ CoordinatorResult<Void, CoordinatorRecord> 
classicGroupJoinToClassicGroup(
         // is specified but the group does not exist, the request is rejected 
with
         // UNKNOWN_MEMBER_ID.
         ClassicGroup group;
-        if (maybeDeleteEmptyConsumerGroup(groupId, records)) {
-            log.info("[GroupId {}] Converted the empty consumer group to a 
classic group.", groupId);
-        } else if (maybeDeleteEmptyStreamsGroup(groupId, records)) {
-            log.info("[GroupId {}] Converted the empty streams group to a 
classic group.", groupId);
+        // Only a request with an unknown member id can create the classic 
group below, so only
+        // such a request deletes an empty consumer or streams group to make 
room for it. A request
+        // with a known member id is rejected with UNKNOWN_MEMBER_ID and keeps 
the group.

Review Comment:
   It follows `JoinGroupRequest#requiresKnownMemberId`, which calls a member id 
set in the request a known member id, as opposed to `UNKNOWN_MEMBER_ID`. The 
term is used in many places in the group coordinator, so I'd keep it here and 
consider a rename separately.
   



-- 
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]

Reply via email to