rafter (in progress) is a pipelined asynchronous multi-raft group library with an in-memory key-value replicated state machine based on seastar.
rafter is deeply inspired by
- prerequisite
- Compiler with C++20 support, tested with clang-12
- Seastar, the installation of Seastar is not trivial, please refer to this post
- GoogleTest, taken care of by rafter's cmake configuration
TBD
The execution module manages and schedules all raft groups, storage, transport and replicated state machines.
TBD
The raft core state machine implements the raft algorithm based on the etcd's design.
- ⭕design doc
- ⭕election
- ⭕prevote
- ⭕leader lease
- ⭕leadership transfer
- ⭕log compaction
- ⭕single membership change
- ⭕joint consensus
- ⭕observer
- ⭕witness
- ⭕quiesce
- ⭕linearizable semantics
The storage module works as the WAL of the raft groups, managing the persistent log entries as well as the snapshots and the configurations of the clusters.
- ✔️design doc (lack in-memory log explanation)
- ✔️segment, a WAL unit
- ✔️segment test
- ✔️index, for indexing raft logs (lack dump&load)
⚠️ index test (lack group index test)- ✔️segment_manager, for managing raft persistent logs
⚠️ segment_manager test
The transport module based on the seastar's rpc framework works as a messaging service for clusters.
⚠️ design doc- ✔️exchanger, for exchanging raft messages
⚠️ exchanger test- ✔️registry, for group discovery and peer addresses management
- ⭕registry test
⚠️ express, for sending/receiving replicated state machine's snapshot- ⭕express test
The replicated state machine is a naive in-memory key-value storage to demonstrate the interactions between a user defined replicated state machine and the underlying framework.
TBD
Various utilities to support different modules of the rafter.
- ✔️backoff, retry in coroutine style
⚠️ circuit_breaker- ✔️fragmented_temporary_buffer, for aligned (de)serialization
⚠️ rate limiter- ✔️serializer, for raft message's (de)serialization
- ✔️worker, double-buffering multi-producer single-consumer worker coroutine, building block for pipelined service in rafter
The test module hacks the interface of the GoogleTest to support testing an asynchronous application with GoogleTest's style.
- ✔️base, for integrating the coroutine and the gtest macros, and the Seastar's reactor engine management
⚠️ unit tests- ⭕integration tests
- ⭕benchmark
in progress
TBD