CCAAK practice question 14 of 15
You have a Kafka cluster with topics t1 and t2. In the output below, topic t2 shows Partition 1 with a leader “-1”. What is the most likely reason…
Full set: 54 questionsThe output Leader: -1 for a partition signifies that there is currently no active leader. This happens when the broker that was the leader becomes unavailable, and no other in-sync replica can be elected to take its place. In this specific case, the output for Topic: t2 Partition: 1 shows Replicas: 1. This indicates that Broker 1 is the only broker assigned to hold a replica for this partition. Therefore, if Broker 1 fails or becomes unreachable, the partition has no available replicas, the controller cannot elect a new leader, and the leader ID is set to -1 to indicate its unavailability.
B. Log cleaning is a background process for compacted topics and does not cause a partition to lose its leader or become unavailable.
C. Data compression is a configuration that affects the size of messages but has no impact on broker availability or the leader election process.
D. Kafka's architecture for identifying partitions (by topic name and partition index) prevents naming clashes; this is not a recognized failure mode.
1. Kafka: The Definitive Guide, 2nd Edition by Narkhede, N., Shapira, G., & Palino, T. (O'Reilly Media, 2021).
Chapter 6, Reliability, "Replication" section: Explains that if a broker containing the only replica of a partition fails, that partition becomes unavailable. The controller cannot elect a new leader because no other replicas exist. This state is reflected by a leader ID of -1.
2. Apache Kafka Official Documentation, Section 8.2 Replication:
"The leader for a partition is one of the brokers... If the leader broker fails, one of the follower brokers will become the new leader." This documentation establishes the direct link between broker failure and leader re-election. In a scenario with a replication factor of 1 (Replicas: 1), the failure of the single broker means there are no followers to become the new leader.
3. Confluent Documentation, "Unbalanced Kafka Clusters":
In discussions about cluster health, a partition with no leader (-1) is a critical indicator of a problem, most commonly an offline broker that is the sole member of that partition's replica set. The documentation on monitoring and balancing frequently cites offline brokers as the cause for partitions lacking a leader.
Keep practicing
Take the free CCAAK practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CCAAK practice questions
- Question 1When a broker goes down, what will the Controller do?
- Question 2A developer is working for a company with internal best practices that dictate that there…
- Question 3A company is setting up a log ingestion use case where they will consume logs from numero…
- Question 4If the Controller detects the failure of a broker that was the leader for some partitions…
- Question 5Where are Apache Kafka Access Control Lists stored'?
- Question 6Which tool is used for scalably and reliably streaming data between Kafka and other data …
