Skip to main content

Consensus

System Analysis

ArchitecturePRODUCTION

Normal Behavior

The process of designating a single node as the coordinator for tasks in a distributed cluster.

Failure Behavior

Results in a 'split brain' scenario where two nodes both believe they are the undisputed leader, destroying data consistency.

Business Consequence

Critical transactions are processed twice or overwritten as competing leaders fight for control of the database.

Visual Manifestation

"Two glowing server icons furiously sending conflicting red arrows to a shared storage drive."

Satirical Behavior

"A continuous, highly aggressive game of musical chairs played by servers, where if two servers sit in the same chair, the entire database explodes."

Known Aliases

ConsensusMaster Election

Technical Terminology

Raft consensusQuorumAcquiring lock

Failure Indicators

Split brainElection timeoutLoss of quorum

System Architecture (Graph)

Click or hover to interact

Used By (Characters)

FAQ

How does it normally behave?

The process of designating a single node as the coordinator for tasks in a distributed cluster.

How does it fail?

Results in a 'split brain' scenario where two nodes both believe they are the undisputed leader, destroying data consistency.

What is the business consequence?

Critical transactions are processed twice or overwritten as competing leaders fight for control of the database.

What is a split-brain scenario in distributed systems and how do fencing tokens prevent data corruption?

Split-brain occurs when a network partition divides a cluster into isolated groups, causing nodes on both sides to declare themselves as the active leader. A fencing token is a monotonically increasing counter (epoch) issued with each new leadership election. When a leader writes to storage, the storage system checks the token against its highest seen epoch; if a partitioned zombie leader attempts a write with an outdated token, the write is immediately rejected, preventing silent data corruption.

Why must distributed consensus clusters always consist of an odd number of voting nodes?

Consensus algorithms require a strict majority quorum (N/2 + 1) to agree before taking any authoritative action or electing a leader. An odd number of nodes provides the optimal fault tolerance per node cost: a 3-node cluster can tolerate 1 failure (majority = 2), and a 5-node cluster can tolerate 2 failures (majority = 3). Having an even number (like 4) still requires 3 nodes for a majority, tolerating only 1 failure—meaning the 4th node adds cost without improving resilience.

AI Summary

Leader Election Engine is a ARCHITECTURE system in TinyCTO.tv. Cluster nodes exchange periodic heartbeat messages. If the incumbent leader fails or stops sending heartbeats within a configured election timeout, follower nodes transition to candidate state and initiate an election term. Once a candidate receives votes from a strict quorum (majority: N/2 + 1), it claims leadership, increments the epoch counter, and assumes exclusive coordination duties.