Cloudflare Adopts QuePaxa, a Leaderless Consensus Algorithm
Cloudflare has introduced QuePaxa, a novel consensus algorithm designed to maintain progress without relying on a stable leader. Unlike traditional leader-based approaches, QuePaxa allows nodes to make progress despite leader failures, potentially reducing delays caused by leader election and recovery. By Renato Losio
Cloudflare has unveiled QuePaxa, a fresh consensus algorithm intended to keep operations moving forward without depending on a stable leader. This algorithm diverges from traditional leader-based methods, enabling nodes to advance despite the absence of a reliable leader, which can help minimize delays stemming from leader election and recovery processes.
As previously highlighted by InfoQ, Cloudflare employs QuePaxa in Meerkat, an experimental distributed consensus service aimed at enhancing coordination among geographically dispersed infrastructure components. The team of engineers at Cloudflare - João Pedro Leite, Bob Halley, and James Larisch - highlight QuePaxa as an unconventional selection, as most consensus systems utilize well-established algorithms such as Raft, (Multi-)Paxos, or Viewstamped Replication.
While these algorithms are widely understood, have dependable implementations, and generally perform effectively, they often encounter challenges in wide-area networks with unreliable network connectivity and latency, particularly the Internet where Meerkat operates. Consensus algorithms facilitate a group of machines to reach a consensus on a shared value, even when some machines fail or lose connectivity, ensuring that no machine makes conflicting decisions.
QuePaxa progresses through four stages in each round. During each stage, proposers transmit their current proposals to all recorders and proceed once they receive replies from a majority. They progressively incorporate and propagate the proposal with the highest priority, subsequently verifying if there is adequate agreement to make a decision about a value.
If a decision cannot be reached, they retain the most informed proposal to proceed to the next round. The trio further explains that Meerkat's evaluations, spanning servers across nearly all continents, have directly demonstrated QuePaxa's influence on overall system performance and availability. Notably, Meerkat continues processing requests even when the leader crashes, disconnects, or becomes sluggish, without any instances of complete stagnation.
This aligns with the team's objectives. Unlike conventional consensus algorithms, QuePaxa does not rely on a functioning leader to make progress. Any node can propose a value, and a brief, configurable timeout permits other nodes to proactively assume leadership responsibilities without waiting for leader failure detection. Manas Maheshwari, a senior software engineer at Apex, discusses the significance of this development on LinkedIn.
He argues that the true advantage of QuePaxa lies not in being leaderless for its own sake, but in the fact that a mistaken assumption about failure results in reduced throughput rather than complete unavailability. In a global network, slow and dead conditions can appear similar for an extended period, leading to recovery logic becoming the primary source of the outage.
Maheshwari believes that transitioning from one round trip to three without halting represents the appropriate balance. On Reddit, users inquire about Cloudflare's approach to preventing multiple leaders from engaging in proposals concurrently. User leros expresses surprise at Cloudflare's continued innovation in core technologies like consensus algorithms, suggesting that such advancements might have been anticipated 10-20 years ago. The research paper detailing QuePaxa's algorithm can be accessed on ACM.
Rewritten by urgent.news; may contain errors — check the original.
Source: infoq.com