Membership Changes
// TODO
Rough Notes
Section titled “Rough Notes”Approach
Section titled “Approach”Single-server changes only: add or remove one node at a time. This guarantees no two overlapping majorities can exist during a transition, avoiding split brain by construction. Joint consensus is covered in the next stage.
Implementation
Section titled “Implementation”- Replicate config change as a log entry; new config takes effect on commit
- New nodes join as non-voting members first and catch up before being added to voting membership (prevents a lagging new node from stalling commits)
- Quorum calculation updates when the config entry is applied
- If the leader removes itself, it steps down after the entry commits
- One config change at a time; reject a new change if one is already in progress
Cluster Management API
Section titled “Cluster Management API”POST /cluster/join
Section titled “POST /cluster/join”Join a cluster.
POST /cluster/join
{ "leader": "10.0.42.101:8080"}
----
200POST /cluster/leave
Section titled “POST /cluster/leave”Leave the cluster.
POST /cluster/leave
----
200Resources
Section titled “Resources”- The Raft Consensus Algorithm
- Students’ Guide to Raft by Jon Gjengset