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


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/TopicMetadata.java:
##########
@@ -41,10 +41,25 @@ public class TopicMetadata {
      */
     private final int numPartitions;
 
+    /**
+     * Map of every partition Id to a set of its rack Ids, if they exist.
+     * If rack information is unavailable for all partitions, this is an empty 
map.
+     */
+    private final Map<Integer, Set<String>> partitionRacks;

Review Comment:
   > Does `PartitionAssignor` guarantee idempotency ?
   
   From source code, I think no. The `PartitionAssignor#assign` takes 
`GroupSpec`. The `GroupSpec#memberSubscription` returns member data. The 
`MemberSubscription#subscribedTopicIds` only returns subscribed topic ids. In 
conclusion, `PartitionAssignor` can only get subscribed topics from 
`GroupSpec`, so unrelated topics don't change the result.
   
   
https://github.com/apache/kafka/blob/d7ac865fb0d2f739392623a379d056a7bf3c19f4/group-coordinator/group-coordinator-api/src/main/java/org/apache/kafka/coordinator/group/api/assignor/PartitionAssignor.java#L34-L45
   
   
https://github.com/apache/kafka/blob/d7ac865fb0d2f739392623a379d056a7bf3c19f4/group-coordinator/group-coordinator-api/src/main/java/org/apache/kafka/coordinator/group/api/assignor/GroupSpec.java#L45-L52
   
   
https://github.com/apache/kafka/blob/d7ac865fb0d2f739392623a379d056a7bf3c19f4/group-coordinator/group-coordinator-api/src/main/java/org/apache/kafka/coordinator/group/api/assignor/MemberSubscription.java#L44-L50



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