Skip to main content
← PROBLEMS / ARCHITECTURE
An end-to-end domain learning journey

Handling Asymmetric Network
Partitions & Split-Brain.

A non-transitive partition between Node A and Node C leaves Node B connected to both, triggering continuous Raft term inflation, leader step-downs, and 100% lock-service unavailability.
Start the journey5 stages
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

To keep the architecture evolvable without sacrificing reliability, enable Raft Pre-Vote and CheckQuorum (or SWIM indirect probing) to stop disruptive elections, use ReadIndex for linearizable reads, and enforce monotonic fencing tokens at downstream storage.

TL;DR30-second simplified summary
▾

Core Mechanics: Distributed lock managers and metadata stores (etcd, Consul, ZooKeeper) assume transitive reachability, yet real cloud networks frequently suffer one-way or pairwise BGP/ACL blackholes.

Visual & Structural Flow: Depicts Asymmetric A-C Drop with Bridge Node B (Node B (Bridge) -> Node A (Leader) -> Node C (Follower)); Pre-Vote & CheckQuorum Election Guardrails (FOLLOWER -> PRE-VOTE -> LEADER).

Trade-Offs & Production: Increasing the election timeout from 500 ms to 5,000 ms only delays the livelock while violating the <= 1,500 ms failover SLA. Every production consensus engine enables these defenses by default: etcd & Kubernetes Control Plane: Uses --pre-vote=true and CheckQuorum so AZ-level ACL glitches never trigger API-server leader churn.

Failure Modes & Application: Every production consensus engine enables these defenses by default: etcd & Kubernetes Control Plane: Uses --pre-vote=true and CheckQuorum so AZ-level ACL glitches never trigger API-server leader churn.

Full walkthrough · 5 stages
01
STAGE 01 · WHY IT MATTERSL4 · FUNDAMENTALS

Why asymmetric partitions break naive consensus.

Why this matters: The mechanism: understand how Why asymmetric partitions break naive consensus works from first principles.

Think of Why asymmetric partitions break naive consensus as the intuition layer for Handling Asymmetric Network Partitions & Split-Brain: The mechanism: understand how Why asymmetric partitions break naive consensus works from first principles.

Distributed lock managers and metadata stores (etcd, Consul, ZooKeeper) assume transitive reachability, yet real cloud networks frequently suffer one-way or pairwise BGP/ACL blackholes. In a 3-node cluster (A, B, C) handling 4,500 lock ops/sec at p99 < 12 ms, losing only the A <-> C path leaves B healthy with both peers—yet standard Raft without Pre-Vote collapses into an endless election storm.

02
STAGE 02 · IMPACTL5 · APPLIED DESIGN

Term-inflation livelock and zombie-leader corruption.

Why this matters: The problem: see what breaks without Term-inflation livelock and zombie-leader corruption under real concurrency or scale.

When A <-> C drops while A <-> B and B <-> C remain at 0.8 ms RTT:

  1. Term Inflation Livelock: Node C misses A's 100 ms heartbeats, times out at 500 ms, bumps term = T+1, and sends RequestVote to B. B adopts T+1 and forces healthy Leader A to step down; then A times out and bumps to T+2, causing 100% unavailability.
  2. Zombie Leader Stale Reads: An isolated leader serving local memory reads returns stale lock ownership until its lease expires.
  3. Delayed Zombie Writes: In-flight packets from deposed Leader A can land at downstream PostgreSQL/KV storage after C already acquired a newer lock.
Non-Transitive Partition

Asymmetric A-C Drop with Bridge Node B

Node B (Bridge)Sees both A & C (0.8ms)Node A (Leader)A<->C dropped; forced…Node C (Follower)Misses A heartbeats ->…A <-> C blackholed

Node B hears A's heartbeats and C's higher-term RequestVote, causing continuous leader churn without Pre-Vote.

Engineering Decision Framework
Problem
How to implement Handling Asymmetric Network Partitions & Split-Brain without hitting unbounded tail latency, state divergence, or operational fragility.
Naive Solution
Use a single unpartitioned path with unbounded retries and synchronous global coordination.
Why It Fails
Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
Alternatives
Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
Engineering Decision
To keep the architecture evolvable without sacrificing reliability, enable Raft Pre-Vote and CheckQuorum (or SWIM indirect probing) to stop disruptive elections, use ReadIndex for linearizable reads, and enforce monotonic fencing tokens at downstream storage.
Trade-Offs
Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
Decision Exercise · Make the Call

When Handling Asymmetric Network Partitions & Split-Brain experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?

03
STAGE 03 · NAIVE SOLUTIONL5 · APPLIED DESIGN

Naive mitigations (and why they still fail).

Why this matters: The problem: see what breaks without Naive mitigations under real concurrency or scale.

Think of Naive mitigations (and why they still fail) as the intuition layer for Handling Asymmetric Network Partitions & Split-Brain: The problem: see what breaks without Naive mitigations under real concurrency or scale.

Increasing the election timeout from 500 ms to 5,000 ms only delays the livelock while violating the <= 1,500 ms failover SLA. Similarly, relying on wall-clock leader leases without CheckQuorum fails if a VM experiences a GC pause or hypervisor freeze, allowing two nodes to believe they hold valid leases simultaneously.

Lifecycle & Failure Recovery

Naive mitigations (and why they still fail)

election timeoutmajority voteshigher term seenFollowerCandidate ElectionElected LeaderMinority Isolated
04
STAGE 04 · ENTERPRISE SOLUTIONL6 · SCALE & TRADE-OFFS

Enterprise solution: Pre-Vote, CheckQuorum, ReadIndex & Fencing Tokens.

Why this matters: Operational control: configure bounds, failure handling, and safe production defaults.

Harden both the consensus layer and downstream storage:

  • Raft Pre-Vote: Before incrementing currentTerm, C sends PreVote(term+1). B rejects it because B is actively receiving heartbeats from A (election_timeout has not elapsed), eliminating term inflation with < 0.8 ms overhead on real failovers.
  • CheckQuorum: Leader A steps down automatically if it fails to receive heartbeat ACKs from a majority within election_timeout (500 ms).
  • ReadIndex: Linearizable reads confirm leadership via a 0.8 ms heartbeat round before serving at commitIndex.
  • Monotonic Fencing Tokens: Every lock acquisition returns (raft_term, log_index) and storage enforces WHERE fencing_token < :new_token.
Hardened Raft Protocol

Pre-Vote & CheckQuorum Election Guardrails

election_timeout elapsedmajority PreVote + VoteB rejects (A alive)CheckQuorum lostFOLLOWERRejects PreVote if leadePRE-VOTEProbes quorum without buLEADERCheckQuorum + ReadIndex

Pre-Vote prevents partitioned Node C from bumping terms while B still hears healthy Leader A.

def handle_pre_vote(node, candidate_term: int, last_log_idx: int, last_log_term: int) -> bool:
    # Reject PreVote if we heard from a valid leader within election_timeout
    if node.time_since_leader_heartbeat_ms() < node.election_timeout_ms:
        return False
    if candidate_term < node.current_term:
        return False
    return (last_log_term, last_log_idx) >= (node.last_log_term, node.last_log_idx)

# Downstream storage fencing (PostgreSQL)
# UPDATE resource_locks SET owner = :owner, fencing_token = :token
# WHERE resource_id = :id AND fencing_token < :token;
05
STAGE 05 · SYSTEM DESIGN APPLICATIONSL7 · STAFF / PRINCIPAL

Where asymmetric partition defenses run in production.

Why this matters: Scope boundary: identify where this pattern fits best and where simpler or async alternatives win.

Every production consensus engine enables these defenses by default:

  • etcd & Kubernetes Control Plane: Uses --pre-vote=true and CheckQuorum so AZ-level ACL glitches never trigger API-server leader churn.
  • HashiCorp Consul & SWIM Gossip: Uses indirect ping-req probing through healthy peers before marking an asymmetrically unreachable node dead.
  • Distributed Lock & Storage Services: Attaches Raft/ZooKeeper zxid fencing tokens to block delayed writes from paused leaders.
Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

In a 3-node Raft cluster where A<->C is severed but B can reach both, how does Raft Pre-Vote stop term-inflation livelock?

Recommended Learning Flow