chia7712 commented on code in PR #17444:
URL: https://github.com/apache/kafka/pull/17444#discussion_r1817881509
##########
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:
> Ideally, assignors should generate deterministic results, so it doesn't
trigger useless rebalance.
I don't think this is easy to follow. For instance, assignors typically loop
through members, topics, or partitions to calculate the assignment, but we
don't enforce a specific order for these objects in the input.
> For metadata change, there are two cases can trigger group rebalance:
The rack of a partition can change if the partition is moved from node_a in
rack_a to node_b in rack_b.
> Finally, we can set a new value in ModernGroup. When above cases are
detected in GroupMetadataManager#onNewMetadataImage, we set the value to true.
In new consumer group heartbeat, we don't need to calculate subscription
metadata, we can check the value and calculate a new target assignment
directly. After we gets new target assignment, we set the value back to false.
--
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]