squah-confluent commented on code in PR #20055:
URL: https://github.com/apache/kafka/pull/20055#discussion_r2174220247


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/consumer/CurrentAssignmentBuilder.java:
##########
@@ -215,6 +254,56 @@ private boolean ownsRevokedPartitions(
         return false;
     }
 
+    /**
+     * Updates the current assignment, removing any partitions that are not 
part of the subscribed topics.
+     *
+     * @param memberAssignedPartitions  The assigned partitions of the member 
to use.
+     * @return A new ConsumerGroupMember.
+     */
+    private ConsumerGroupMember computeCurrentAssignment(
+        Map<Uuid, Set<Integer>> memberAssignedPartitions
+    ) {
+        Set<Uuid> subscribedTopicIds = subscribedTopicIds();
+        if (subscribedTopicIds == null) {
+            // The member's subscribed topic regex is unresolved, so we cannot 
tell whether topics
+            // are part of its subscription.
+            return member;
+        }

Review Comment:
   I guess that would be better for consistency with the client's subscription. 
I've made the change and added tests for unresolved vs resolved regexes at the 
`CurrentAssignmentBuilder` level. There's an existing `GroupMetadataManager` 
test that runs through the regex update flow.



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