Consensus algorithm implementation (RAFT)
from paper https://raft.github.io/raft.pdf
demonstration http://thesecretlivesofdata.com/raft/
run main
in class Test
- leader election
- logs replication
- membership change
- log compaction
Note #1: this project only for educational purpose, those features will not be optimized for production
Note #2: membership change
and log compaction
are not implemented since we only need leader election
and logs replication
- network emulation
- join/leave network
- transport (send, recv, broadcast)
- message encapsulation
- async IO (simple message queue)
- network jamming
- test
- timer
- scheduled task
- listen/notify
- change timeout
- test
- raft
- rpc
- AppendEntries
- AppendEntries response (custom)
- RequestVote
- RequestVote response
- test
- client command (deposit, withdraw)
- test
- states
- leader
- heartbeat
- send logs
- test
- voter
- handle RequestVote message
- test
- candidate
- broadcast RequestVote
- collect votes
- test
- follower
- handle AppendEntries message
- test
- leader
- FSM
- transition table
- state change listener
- test
- raft log
- test
- rpc