CCDAK practice question 17 of 25

There are 3 producers writing to a topic with 5 partitions. There are 5 consumers consuming from the topic. How many Controllers will be present in the cluster?

Full set: 150 questions
Answer options
A: 3
B: 5
C: 2
D: 1 Correct answer
Correct Answer:
D. 1
Explanation

In any Apache Kafka cluster, there is always exactly one active Controller. The Controller is a specific broker that is elected from the pool of live brokers in the cluster. Its primary responsibility is to manage the state of the cluster, including partitions, replicas, and handling broker failures. The number of producers, consumers, topics, or partitions has no influence on the number of active Controllers. This architectural design ensures a single point of responsibility for cluster-wide administrative tasks, preventing split-brain scenarios.

Why Incorrect

A. 3: This number corresponds to the producers in the scenario and is irrelevant to the number of controllers, which is a fixed architectural constant.
B. 5: This number corresponds to the partitions and consumers and does not determine the number of controllers.
C. 2: This is an arbitrary number; a Kafka cluster is designed to have only a single active controller, not two.

References

1. Confluent Documentation, "Apache Kafka® Architecture": Under the "Controller" section, it states, "One of the brokers in the cluster is designated as the controller. The controller is responsible for administrative operations, including creating, deleting, and altering topics, as well as managing broker membership and reassigning partitions." This confirms a single broker acts as the controller.

Source: Confluent Documentation, Apache Kafka Architecture > Controller.

2. Apache Kafka Documentation, "4. Design": Section 4.2, "Replication," details the controller's role. It specifies, "In Kafka, we have decided to elect one of the brokers as the 'controller'. This controller detects broker level failures and is responsible for changing the leader of all affected partitions in a failed broker." The use of the singular "one of the brokers" is explicit.

Source: Apache Kafka Official Documentation, kafka.apache.org, Design > Replication.

3. Kreps, J., Narkhede, N., & Rao, J. (2011). "Kafka: a Distributed Messaging System for Log Processing.": In Section 3.2, "Distribution," the foundational paper on Kafka states, "One of the brokers in the cluster functions as the controller, which is responsible for electing leaders." This academic source confirms the single-controller design from its inception.

Source: Proceedings of the NetDB, 2011, Section 3.2.

Scroll to Top