Augmenting Flexible Paxos in LogDevice to improve read availability
LogDevice, Meta's distributed log store built on flexible Multi-Paxos, removed a core Flexible Paxos trade-off. Small write quorums had made leader election need large quorums, so routine maintenance and failures often left recovery stuck and broke read SLAs. The fix has the active leader track a reduced write set of available acceptors and persist it through a special reconfiguration write that every future leader sees during election. A quorum over that write set is then enough to elect a new leader. After rollout, stuck recoveries dropped to zero, read availability SLA misses largely disappeared, and the ZooKeeper-based membership fallback is no longer needed for leader failover, which enabled linearizable writes.
Related posts
- Building and deploying MySQL Raft at Meta
Meta Engineering hardMasterMeta replaced its MySQL semisynchronous replication, whose failover and membership changes were orchestrated by external Python automation, with MySQL Raft, a Raft consensus engine built into mysqld. Control plane operations (promotions, membership changes) and data now share one replicated log, the existing binlog. That moves leadership and membership truth into the server and gives provable safety, faster failover and simpler operations, with comparable write performance. The implementation is based on a kuduraft fork that adds FlexiRaft, a Flexible Paxos-inspired scheme with a small in-region data quorum and a larger leader-election quorum, along with proxying, compression and log abstraction. The post also covers the write commit path, crash-recovery cases and one-at-a-time membership changes.
- Choosing QuePaxa, an unusual consensus algorithm
Cloudflare hardMasterCloudflare's Meerkat, a globally distributed consensus service for its internal control plane, uses QuePaxa instead of Raft or Multi-Paxos. Leader-based protocols stall over wide-area networks: mistaken or slow fault detection triggers leader elections, and competing candidates can interfere destructively and cause metastable failures. QuePaxa avoids this with an optional leader, no reliance on fault detection, and randomized priorities that make proposers converge on the highest-priority proposal. It still decides in one round trip through the leader in good conditions and degrades gracefully otherwise. Its hedging timeout is not fault detection, so it can be very small (e.g., 5ms on 100ms links) without freezing the system.
- How we built a general purpose key value store for Facebook with ZippyDB
Meta Engineering hardMasterZippyDB is Facebook's largest strongly consistent, geo-distributed key-value store, built by layering a reusable replication library (Data Shuttle) on RocksDB, Shard Manager and a ZooKeeper-based config service. Shards of 50–100 GB hold tens of thousands of μshards, enabling transparent resharding. Each shard keeps a small Multi-Paxos quorum plus async follower replicas, with epoch-based leader leases assigned externally. Consistency is chosen per request: fast-ack or quorum writes, and eventual (actually bounded-staleness), read-your-writes or lease-based strong reads. Serializable transactions use optimistic concurrency control on the primary within an epoch, and conditional writes reuse that machinery server-side.
- How we use formal modeling, lightweight simulations, and chaos testing to design reliable distributed systems
Datadog Engineering hardMasterDatadog validated the design of Courier, a multi-tenant message queue built on multiple FoundationDB clusters after its March 2023 outage, by combining TLA+ formal modeling, lightweight simulations and chaos testing. Each tenant is sharded across 4 of 8 FoundationDB clusters so that no two tenants share the same set, and brokers health-check clusters and route around failures. The TLA+ spec models brokers, senders and receivers with weak fairness, and TLC checks properties such as at-least-once delivery across every reachable state. Simulations then cover what model checking cannot, such as latency, cost and scalability. Together these give design-level confidence that unit tests miss, at the cost of keeping models and simulations in sync with the design.
- When failover isn’t safe: Building high-availability PostgreSQL on Kubernetes
Datadog Engineering mediumAdeptA staging gameday simulating zonal network latency left Datadog's Kubernetes-hosted PostgreSQL clusters stuck: with asynchronous replication, every standby exceeded Patroni's maximum_lag_on_failover, so no failover candidate could be promoted safely. The fix is a hybrid model in which leader-pool standbys replicate synchronously while read replicas stay asynchronous. Patroni is configured with synchronous_mode, synchronous_node_count=1 and synchronous_mode_strict, and PostgreSQL with synchronous_commit=remote_apply, so a failover candidate is always current. pgbench TPC-B benchmarks across synchronous_commit levels quantify the latency and throughput cost of each durability option.