Swift implementation of the Raft protocol, more detailed paper
Visualisation of the protocol
- Leader Election
- Log Replecation
- Safety
- Election restriction
- Commiting entries from previous terms
- Peristed state (term and log)
- Memory log
- Segmented log
- Leadership Transfer
- Fixed peers
- Add/Remove server RPC call
- New servers log distribution
- Memory based snapshots
- Add Linux tests
- Setup CI
Run Jepsen tests with maelstrom.
maelstrom test -w lin-kv --bin maelstrom-node --time-limit 10 --rate 10 --nodes 1,2,3
Where maelstrom-node
is a bin.
And --nodes
list of nodes in local cluster.
maelstrom-node
also can be a bash wrapper, if you want to run binary with snapshot toolchain
#!/usr/bin/env bash
# Add toolchain libs to the library path. Need for _Concurrency library.
export DYLD_FALLBACK_LIBRARY_PATH=/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2021-03-02-a.xctoolchain/usr/lib/swift/macosx
# Run compiled binary
exec .build/debug/maelstrom-node
To compile the project you need to use snapshot toolchain with Actors support.