Kafka hard
A Topic has `ReplicationFactor=3` and `min.insync.replicas=2`. A Producer uses `acks=all`. If two out of the three brokers in the cluster fail simultaneously, what will be the response for new Produce requests?
- A The cluster will automatically downgrade the request to `acks=1` to maintain availability.
- B The broker will return a `NotEnoughReplicasException`. Since only 1 replica remains (which is < the required 2 for the ISR gate), the write is rejected to prevent consistency risk.
- C The write will succeed but with a warning that data is 'fragile'.
- D The message will be redirected to an internal 'Purgatory' topic until the other nodes reboot.
Answer: B. The broker will return a `NotEnoughReplicasException`. Since only 1 replica remains (which is < the required 2 for the ISR gate), the write is rejected to prevent consistency risk.
This is a fundamental durability checkpoint. By setting `min.insync.replicas=2`, you are telling Kafka: 'Do not accept a write unless at least two nodes have a copy.' If only one node is left, accepting a write would be dangerous because if that last node dies before the others return, that data is lost forever.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When implementing 'Exactly-Once Semantics' (EOS) in a Kafka stream, what is the role of the `isolation.level=read_committed` setting on the Consumer?
- Historically, which external service was required by Kafka to manage cluster hierarchy, metadata, and leader election status?
- Once a message is successfully appended to a Kafka partition log, what is its mutability status?
- In a Kafka cluster, what is the role of a 'Broker'?
- What is the primary indicator of a bottleneck in a Kafka consumer's processing logic?
- What is the primary architectural role of Apache Kafka in a distributed system?