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


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -3038,6 +3042,59 @@ private void replaceMember(
         ));
     }
 
+    /**
+     * Maybe delete the resolved regular expression associated to the provided 
member if
+     * it was the last subscribed member to it.
+     *
+     * @param records   The record accumulator.
+     * @param group     The group.
+     * @param member    The member removed from the group.
+     */
+    private void maybeDeleteResolvedRegularExpression(
+        List<CoordinatorRecord> records,
+        ConsumerGroup group,
+        ConsumerGroupMember member
+    ) {
+        if (isNotEmpty(member.subscribedTopicRegex()) && 
group.numSubscribedMembers(member.subscribedTopicRegex()) == 1) {
+            records.add(newConsumerGroupRegularExpressionTombstone(
+                group.groupId(),
+                member.subscribedTopicRegex()
+            ));
+        }
+    }
+
+    /**
+     * Maybe delete the resolved regular expressions associated with the 
provided members
+     * if they were the last ones subscribed to them.
+     *
+     * @param records   The record accumulator.
+     * @param group     The group.
+     * @param members   The member removed from the group.
+     * @return The set of deleted regular expressions.
+     */
+    private Set<String> maybeDeleteResolvedRegularExpressions(

Review Comment:
   this is tested by 
`testResolvedRegularExpressionsRemovedWhenConsumerMembersRemovedByAdminApi`. i 
am not sure to follow your suggestion about having a member subscribed to both 
`foo` and `foo*`. this code does not look at topic names at all. could you 
please elaborate?



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