Split-brain, consensus, and quorum
partition handling.
split-brain is two nodes both believing they are leader during a partition; Raft/Paxos require a majority quorum to elect a leader and commit, so the minority side cannot make progress.
What's really being asked
Whether you understand the failure mode of dual leadership under partitions and how majority-based consensus structurally prevents divergent committed state.
Why it matters
Split-brain occurs when a network partition divides a cluster and each side independently believes it holds leadership. If both sides accept writes, they diverge irreconcilably, and merging later may silently drop or corrupt data. This is the worst outcome for a system of record.
The full answer
Consensus algorithms like Raft and Paxos prevent split-brain by requiring a majority quorum, more than half of all nodes, for two critical actions: electing a leader and committing a log entry. A candidate becomes leader only after receiving votes from a majority, and in any partition at most one side can hold a majority. The minority side cannot elect a leader nor commit writes, so it correctly refuses to make progress and serves at most stale reads. Raft adds monotonically increasing terms so stale leaders are detected and stepped down.
The mistakes people make
Claiming heartbeats or timestamps alone prevent split-brain, allowing the minority partition to keep writing, or confusing a quorum with simply any two nodes regardless of cluster size.
What usually comes next
Why odd cluster sizes are preferred; what happens with an even split; how fencing tokens stop a deposed leader's late writes from being applied.
A concrete example
A five-node cluster partitions three-to-two. The three-node side retains a majority, elects a leader, and continues committing. The two-node side cannot reach the quorum of three, so it stops accepting writes. When the partition heals, the two stale nodes replay the leader's log and rejoin cleanly with no divergence.
Interview question
A 5-node Raft cluster partitions into groups of 3 and 2. What happens on the 2-node side?
- a.Both sides freeze until the partition heals
- b.It commits writes but marks them tentative
- c.It elects its own leader and accepts writes
- d.It cannot reach quorum, so it cannot elect a leader or commit writesCorrect
Why? this is the answer
Raft requires a majority (3 of 5) to elect a leader and commit, so the 2-node minority cannot make progress, preventing split-brain. The 3-node majority side continues normally, so the cluster does not fully freeze.
Just read this? Test yourself on what you have been reading.
Read the original → raft.github.io
- #consensus
- #raft
- #quorum
- #split-brain
- #distributed-systems
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles