gabriellefu commented on code in PR #22213:
URL: https://github.com/apache/kafka/pull/22213#discussion_r3327765553


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -2189,6 +2190,27 @@ private CoordinatorResult<StreamsGroupHeartbeatResult, 
CoordinatorRecord> stream
                 )
         ));
 
+        String rackAwareTagsValue = 
currentAssignmentConfigs.getOrDefault("rack.aware.assignment.tags", "");
+        if (!rackAwareTagsValue.isEmpty()) {
+            List<String> requiredTags = 
Arrays.stream(rackAwareTagsValue.split(",", -1))
+                .filter(tag -> !tag.isEmpty())
+                .collect(Collectors.toList());
+            Set<String> memberTagKeys = updatedMember.clientTags().keySet();
+            List<String> missingTags = requiredTags.stream()
+                .filter(tag -> !memberTagKeys.contains(tag))
+                .collect(Collectors.toList());
+            if (!missingTags.isEmpty()) {
+                returnedStatus.add(
+                    new Status()
+                        
.setStatusCode(StreamsGroupHeartbeatResponse.Status.MISSING_CLIENT_TAGS.code())
+                        .setStatusDetail(
+                            String.format("Missing required client tags for 
rack-aware standby assignment: %s. " +
+                                "Configure them via 'client.tag.<tagKey>' in 
your Streams config.", missingTags)
+                        )
+                );
+            }
+        }
+

Review Comment:
   I think this make sense, but I am not sure if the type of rack is limited, I 
can investigate this.



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