chia7712 commented on code in PR #17444:
URL: https://github.com/apache/kafka/pull/17444#discussion_r1815505034


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/ModernGroup.java:
##########
@@ -388,10 +386,25 @@ public Map<String, TopicMetadata> 
computeSubscriptionMetadata(
         subscribedTopicNames.forEach((topicName, count) -> {
             TopicImage topicImage = topicsImage.getTopic(topicName);
             if (topicImage != null) {
+                Map<Integer, Set<String>> partitionRacks = new HashMap<>();
+                topicImage.partitions().forEach((partition, 
partitionRegistration) -> {
+                    Set<String> racks = new HashSet<>();
+                    for (int replica : partitionRegistration.replicas) {
+                        Optional<String> rackOptional = 
clusterImage.broker(replica).rack();

Review Comment:
   @dajac thanks for your response. 
   
   > It should not cause issues because the assignment should only change if 
the consumers are not aligned with racks anymore. Otherwise, it should stay the 
same.
   
   Yes, that makes sense. However, how do we determine if assignment changes 
require a rebalance or not? For instance, if partition_a currently has replicas 
in [rack_0, rack_1, rack_2] and there are no consumers in rack_2, moving the 
replica from rack_2 to rack_1 should NOT trigger a rebalance, correct? It's not 
an ideal use case, just something for discussion :smiley: 



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