CCDAK practice question 13 of 25
By default, which replica will be elected as a partition leader? (select two)
Full set: 150 questionsBy default, Kafka has two primary scenarios for electing a partition leader. First, during a broker failure, the controller must elect a new leader. To prevent data loss, the default configuration (unclean.leader.election.enable=false) mandates that the new leader must be chosen from the set of followers that are fully caught up, known as the In-Sync Replicas (ISR). Second, Kafka uses a "preferred leader" concept for load balancing. By default, automatic leader rebalancing is enabled (auto.leader.rebalance.enable=true). This feature periodically checks if a partition's current leader is its preferred leader. If not, and the preferred leader is in the ISR, a leader election is triggered to move leadership back to that specific broker.
B. By default (unclean.leader.election.enable=false), only in-sync replicas are eligible for leadership to prevent data loss. Replicas that are not in-sync cannot be elected.
C. This is incorrect because it describes a non-default configuration. By default, auto.leader.rebalance.enable is set to true, not false.
1. Apache Kafka Documentation, Section 3.2 Replication: "The basic algorithm for leader election is simple: if a leader fails, a new leader is chosen from the set of in-sync replicas." This directly supports option D.
2. Confluent Documentation, Broker Configuration unclean.leader.election.enable: The default value is false, which "disables the ability to elect a leader from outside the ISR, ensuring no data loss." This directly refutes option B.
3. Confluent Documentation, Broker Configuration auto.leader.rebalance.enable: The default value is true. The documentation states this "Enables automatic leader balancing. A background thread checks and triggers leader elections to balance leadership in the cluster." This supports the scenario described in option A as a default behavior.
4. Designing Data-Intensive Applications by Martin Kleppmann, Chapter 5: Replication, "Leader-Based Replication" section: This academic resource explains that in leader-based replication systems like Kafka, a new leader must be chosen from an up-to-date replica (an in-sync replica) to maintain consistency guarantees. This reinforces the principle behind option D.
Keep practicing
Take the free CCDAK practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CCDAK practice questions
- Question 1In Avro, removing or adding a field that has a default is a __ schema evolution
- Question 2A topic has three replicas and you set min.insync.replicas to 2. If two out of three repl…
- Question 3To get acknowledgement of writes to only the leader partition, we need to use the config.…
- Question 4A customer has many consumer applications that process messages from a Kafka topic. Each …
- Question 5What information isn't stored inside of Zookeeper? (select two)
- Question 6If you enable an SSL endpoint in Kafka, what feature of Kafka will be lost?
