~learn.
0:00 / 1:07
Interview problem · Message queue

The broker said got it. Then its disk died.

transcript

Your message gets an ack. Got it. Then the leader's disk dies. Is your message still alive?

With acks set to 1, the leader acks after its own append. If it dies before the followers fetch, the message is gone. With acks set to all, it waits for every in-sync replica. And at least 2 must be in sync. So every ack is on two brokers. Lose one broker? You lose nothing.

But here's the catch. What if a follower is slow? A slow disk, or a GC pause. Does every write wait for it?

No. A follower that falls behind is dropped from the in-sync set. So the leader only waits for replicas that keep up. But what if too many drop out? Fewer than 2 in sync? Then the partition stops accepting writes.

It won't accept a write it can't protect. That's consistency over availability. Refuse, rather than lie.

Full breakdown in the lecture.