CCAAK · Question #52
In a Kafka cluster, when the broker running the controller thread fails, which broker will become the new controller?
The correct answer is B. The next broker to successfully recreate the Zookeeper ephemeral node. In a Kafka cluster, the controller is the broker responsible for managing partition leadership and other cluster-wide operations. The controller is elected through a Zookeeper-based mechanism. When the current controller broker fails, the cluster needs to elect a new…
Question
In a Kafka cluster, when the broker running the controller thread fails, which broker will become the new controller?
Options
- AThe broker having the next highest broker.id value
- BThe next broker to successfully recreate the Zookeeper ephemeral node
- CThe next broker to persist new metadata in Zookeeper
- DThe next broker in the cluster joined order
How the community answered
(24 responses)- A17% (4)
- B71% (17)
- C4% (1)
- D8% (2)
Explanation
In a Kafka cluster, the controller is the broker responsible for managing partition leadership and other cluster-wide operations. The controller is elected through a Zookeeper-based mechanism. When the current controller broker fails, the cluster needs to elect a new controller. The process works as follows: Each broker in the Kafka cluster creates an ephemeral node in Zookeeper (under /controller). If the current controller broker fails, the Zookeeper ephemeral node corresponding to the controller broker will be deleted. The broker that successfully re-creates the Zookeeper ephemeral node (after detecting the deletion) becomes the new controller. Thus, option B is the correct answer because the new controller is the broker that successfully re- creates this ephemeral node in Zookeeper.
Topics
Community Discussion
No community discussion yet for this question.