consensus

Relaxed Reads in OpenRaft: Linearizable Reads Without Waiting for Apply to Catch Up

Relaxed reads, coming in OpenRaft 0.10.1, let a linearizable read on the leader wait only for the leader’s no-op to be applied, not for apply to catch up with commit. With 500 µs added to each apply batch, p50 read latency fell from 1.2–2.0 ms to 0.92–0.96 ms; when apply fell behind commit, from 2.3 s to 1.2 ms.

Custom Membership in OpenRaft

OpenRaft lets applications define election read quorums and append entries write quorums by replica count, node weight, or site layout. A cluster of 4 nodes can use a read quorum of 3 and a write quorum of 2. Across 3 sites, 9 nodes can commit after 4 replication confirmations.

Adaptive Membership Changes in OpenRaft: Skip Joint Consensus When Quorums Overlap

OpenRaft now skips joint consensus when every old quorum intersects every new quorum. A linear-time test identifies exactly when this is safe for majority-based configurations. It covers Raft’s familiar one-node-at-a-time changes and a few additional cases, while retaining joint consensus for changes that need it.

Raft Membership Changes: When a Leader Must Commit a Current-Term Entry First

Standard joint consensus provides its own log barrier through config entries. Single-step changes and joint consensus extended with rollback require a committed current-term entry before a new config. Two failure scenarios show why the difference comes down to quorum overlap.

Flexible Raft: Read and Write Quorums

A Raft leader usually waits for a majority before committing a write. We can reduce that wait, but the election rules and leader identities must still protect the log. Through a few small clusters, we explore two ways to do this, then follow the consequences for reads, failures, and membership changes.

The Pitfalls of Raft Membership Change

Raft’s single-server membership change carries two problems: its middle state can turn one datacenter into a single point of failure, and the original algorithm could lose a committed entry. Let us look at membership change through quorum sets, and see why joint consensus is the answer.

Build a Distributed Timestamp Oracle with EzRaft

timestamp_oracle is a 200-line timestamp service on EzRaft. A background task reserves ranges through Raft; next_timestamp allocates from memory. Leader leases and term-scoped caches keep the sequence strictly increasing across failovers, with no Raft write on the request path.

EzRaft: Build a Distributed KV Store in 100 Lines

EzRaft builds on OpenRaft and hides the storage, networking, and service layers. Define just four things—Request, Response, apply, and read—and you have a fault-tolerant, three-node distributed KV store.

Raft 成员变更上踩的坑

Raft 在单步成员变更的设计上存在缺陷, 一定要抛弃单步变更, 使用joint consensus