CCAAK practice question 4 of 15

If the Controller detects the failure of a broker that was the leader for some partitions, which actions will be taken? (Choose two.)

Full set: 54 questions
Answer options
A: The Controller waits for a new leader to be nominated by ZooKeeper.
B: The Controller persists the new leader and ISR list to ZooKeeper. Correct answer
C: The Controller sends the new leader and ISR list changes to all brokers. Correct answer
D: The Controller sends the new leader and ISR list changes to all producers and consumers.
Correct Answer:
B. The Controller persists the new leader and ISR list to ZooKeeper.; C. The Controller sends the new leader and ISR list changes to all brokers.
Explanation

When a broker that is a leader for one or more partitions fails, the Kafka Controller is responsible for managing the failover process. The Controller first selects a new leader from the list of in-sync replicas (ISR) for each affected partition. It then performs two critical actions: it persists this new leadership information and the updated ISR list to ZooKeeper to ensure the state change is durable. Concurrently, it sends a LeaderAndIsr request to all live brokers in the cluster, informing them of the new leader so they can update their metadata cache and route client requests correctly.

Why Incorrect

A. The Controller waits for a new leader to be nominated by ZooKeeper. This is incorrect. The Controller is the entity that actively elects the new leader; it does not wait for ZooKeeper to perform this action.
D. The Controller sends the new leader and ISR list changes to all producers and consumers. This is incorrect. The Controller communicates state changes to other brokers. Clients (producers and consumers) discover the new leader by sending metadata requests to any broker.

References

1. Confluent Documentation, Apache Kafka® Internals, "The Controller": "The controller is responsible for electing a new leader... It does so by reading the current list of in-sync replicas from ZooKeeper... The controller then writes the identity of the new leader to ZooKeeper. After this, the controller sends a LeaderAndIsr request to all brokers that contain a replica of the partition (both followers and the new leader)." This directly supports that the Controller writes to ZooKeeper (B) and sends updates to all brokers (C).

2. Apache Kafka Documentation, 3.7, Section 4.2 "Replication": "When the controller notices that a broker has left the cluster... it initiates a leader election for all the partitions that had that broker as their leader... The controller writes the new leader to ZooKeeper and sends a message to all the followers. The new leader begins serving requests from clients and the followers begin to pull from the new leader." This confirms the Controller's role in writing to ZooKeeper and notifying other brokers.

Scroll to Top