Raft
Standard.Raft is the Raft consensus algorithm as a pure state machine: it holds no network, no disk and no clock, which belong to the caller. It follows the shape of etcd's raft library and was written from Diego Ongaro's dissertation. Source of the language: github.com/heikozim/hilde.
- Election, replication, membership changes and snapshots.
- The invariants of the Raft specification as contracts, and asserted after every event in the tests: at most one leader per term, logs that agree on an entry agree before it, every leader holds the committed entries, no two machines differ in what both applied.
- Deterministic tests with partitions: because the machine owns nothing outside, every run of a test is the same.
Standard.RaftTcpsends the messages over TCP, each behind a length prefix.Standard.SqliteReplicareplicates SQLite through Raft, after the pattern of rqlite: only bound parameters, and functions that are not deterministic are refused.
See also databases.