A Java implementation of the Raft consensus algorithm
I'm implementing the protocol in order to get a more in-depth understanding of it. Also as a challenge to make a readable implementation of the "understandable" consensus algorithm.
The parts of the algorithm I have implemented (according to the thesis chapters) are:
Chapter | Name | Status |
---|---|---|
3.4 | Leader election | ✔️ |
3.5 | Log replication | ✔️ |
3.6.1 | Election restriction | ✔️ |
3.6.2 | Committing entries from previous terms | ✔️ |
3.7 | Follower and candidate crashes | ✔️ |
3.8 | Persisted state and server restarts | ✔️ |
3.10 | Leadership transfer extension | ✔️ |
4 | Cluster membership changes | ✔️ |
4.2.1 | Catching up new servers | ✔️ |
4.2.2 | Removing the current leader | ❌ |
4.2.3 | Disruptive servers | ❌ |
4.3 | Arbitrary configuration changes using joint consensus | ❌ |
5 | Log compaction | ✔️ |
6.1 | Finding the cluster | ❌ |
6.2 | Routing requests to the leader | ✔️ |
6.3 | Implementing linearizable semantics | ✔️ |
6.4 | Processing read-only queries more efficiently | ❌ |
The only runtime dependency is log4j 2, the aim is to implement with minimal dependencies