- Complete features including
AppendEntires,RequestVote,InstallSnapshotandPreVote - Design focuses on understanding
- Asynchronous lock-free implementation using EventLoop
- Multi-Raft is supported
-
Nodes communicate with RPC
RaftService. So we provide an Event-Based async RPC Framework based on Netty and Kyro inio.lubricant.consensus.raft.transport. -
Basic operation
Leader Election,Log ReplicationandSnapshot Synchronizationare included inio.lubricant.consensus.raft.context. Besides, we defineRaftContextconcept to isolate irrelevant state machine and provide better concurrency. -
For reliable log persistence, we provide
RaftLogwhich storage its entries in RocksDB. -
RSMmodel could adapt to various application by change itsSateMachine. So we provideRaftMachineinterface, and developer could crate unique Raft application by customizing their ownRaftMachine. -
PreVoteandInstallSnapshotare optional for developers and could be disabled
To show the function of this lib, we simply implement a RaftMachine which only append the data on a file.
Run these 3 main class TestNode1~3 to setup a cluster then try to stop and restart these processes.
If system is functional, all 3 files should be consistent.

