Expand description
Hand-rolled KRaft consensus engine (KIP-595 and KIP-996).
The engine is a pure, deterministic, sans-IO on_event state machine
(core) over the QuorumState and Role model. The async
controller::KraftController drives that state machine over the
log::KraftLog and the real KIP-595 transport wire. This is Krabka’s
live metadata consensus engine.
Re-exports§
pub use controller::Activation;pub use controller::KraftConfig;pub use controller::KraftController;pub use log::KraftLog;pub use transport::Command;pub use transport::Inbound;pub use transport::MetadataFetchSlice;pub use transport::NullPeerSender;pub use transport::PeerSender;pub use transport::QuorumStateSnapshot;pub use transport::TimerTick;
Modules§
- action
- Outputs from the consensus state machine. They are pure side-effect descriptions that the engine executes.
- controller
- The async
KraftControllerconsensus engine. - core
- The
KRaftquorum state machine:on_event(event, log, now) -> Vec<Action>. - event
- Inputs to the consensus state machine.
- log
KraftLog: the replicated metadata log behind theLogViewseam.- role
- The replica’s volatile role within the current epoch and its per-role state.
- snapshot_
fetch - Pure reassembly state machine for a follower that fetches a KIP-630
snapshot over
FetchSnapshot(api key 59). - transport
- Transport seam for the
KraftController. - types
- Core data types for the
KRaftconsensus state machine (KIP-595/996). Pure, sans-IO: no clock, no wire, no log bytes.
Structs§
- LogOffset
Metadata - A log position: an offset together with the leader epoch that produced it.
- NodeId
- A broker, node, replica, or controller identifier.
- Quorum
State - The durable quorum state: the logical content of the
quorum-statefile. - Quorum
State Machine - The hand-rolled KIP-595 + KIP-996 quorum state machine.
- Quorum
Timeouts - The two timer extents of a
QuorumStateMachine, as Kafka’sQuorumConfigholds them. - Replica
Key - Identifies a voter by node id and directory id, as Kafka’s
ReplicaKeydoes. - SimInstant
- A simulated or logical instant in milliseconds.
Enums§
Traits§
- LogView
- Read-only view of the local replicated log that the state machine uses.
Type Aliases§
- Epoch
- Consensus epoch, always non-negative; the wire leader epoch is
krabka_ids::LeaderEpoch.