CCDAK practice question 19 of 25

What happens when broker.rack configuration is provided in broker configuration in Kafka cluster?

Full set: 150 questions
Answer options
A: You can use the same broker.id as long as they have different broker.rack configuration
B: Replicas for a partition are placed in the same rack
C: Replicas for a partition are spread across different racks Correct answer
D: Each rack contains all the topics and partitions, effectively making Kafka highly available
Correct Answer:
C. Replicas for a partition are spread across different racks
Explanation

The broker.rack configuration property enables Kafka's rack awareness feature. When this is configured for each broker, Kafka's replica placement logic attempts to distribute the replicas for any given partition across as many different racks as possible. This strategy enhances fault tolerance by ensuring that the failure of a single rack (e.g., due to a power outage or network switch failure) will not result in the loss of all replicas for a partition. This distribution of replicas across physical failure domains is a key mechanism for achieving high availability in a Kafka cluster.

Why Incorrect

A. The broker.id must be a unique integer for every broker in the cluster, regardless of its rack assignment or any other configuration.
B. This is the opposite of the intended behavior. Placing replicas on the same rack would concentrate the risk and defeat the purpose of rack awareness.
D. Rack awareness distributes replicas of a partition across racks; it does not mandate that every rack contains a replica for every partition in the cluster.

References

1. Apache Kafka Documentation: In the "Broker Configs" section, the description for broker.rack states: "Rack of the broker. This will be used in rack-aware replica assignment for fault tolerance."

Source: Apache Kafka 3.7 Documentation, Section 3.2 Broker Configs, broker.rack.

2. Confluent Documentation: "Rack awareness helps spread replicas of the same partition across different racks. This spreads the risk of a rack-level failure, for example if a network switch in a rack fails, and makes the Kafka cluster more fault-tolerant."

Source: Confluent Platform Documentation, "Manage Clusters" -> "Deploy" -> "Multi-Datacenter and Rack Awareness".

3. Kafka Improvement Proposal (KIP-36): The original proposal for this feature states its goal: "The key idea is to spread replicas of a partition across different racks. As a result, if a rack fails, we only lose at most one replica."

Source: Apache Kafka Wiki, KIP-36: Rack Aware Replica Placement.

Scroll to Top