Bird
0
0

Given the following Kafka cluster state, which broker will be the leader for partition 0?

medium📝 Predict Output Q13 of 15
Kafka - Cluster Architecture
Given the following Kafka cluster state, which broker will be the leader for partition 0?
Broker 1: ISR = [1, 2, 3]
Broker 2: ISR = [1, 2, 3]
Broker 3: ISR = [1, 2, 3]
Current leader: Broker 2
Broker 2 fails
ABroker 2
BBroker 1
CBroker 3
DNo leader assigned
Step-by-Step Solution
Solution:
  1. Step 1: Understand ISR and leader failover

    ISR (In-Sync Replicas) are eligible leaders. When current leader fails, next ISR broker becomes leader.
  2. Step 2: Identify next leader after Broker 2 fails

    Broker 1 and 3 are in ISR. Kafka picks the lowest broker ID in ISR as new leader, so Broker 1.
  3. Final Answer:

    Broker 1 -> Option B
  4. Quick Check:

    Next leader = lowest ISR broker after failure [OK]
Quick Trick: Leader election picks lowest ISR broker if current leader fails [OK]
Common Mistakes:
  • Choosing failed broker as leader
  • Picking broker outside ISR
  • Assuming no leader assigned after failure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes