Skip to main content

Module raft_loop

Module raft_loop 

Source
Expand description

Raft event loop — drives MultiRaft ticks and dispatches messages over the transport.

Split across files:

  • loop_core: RaftLoop struct, constructors, builders, public API (propose, propose_conf_change, group_statuses), and the main run shutdown-driven loop.
  • tick: one iteration of the tick pipeline — drive MultiRaft, dispatch outbound AE/RV, apply committed entries, promote caught-up learners.
  • handle_rpc: inbound RPC routing (impl RaftRpcHandler). The JoinRequest arm delegates to join.
  • join: async server-side JoinRequest orchestration — register peer, propose AddLearner on every group, wait for commit, broadcast topology, persist catalog, build the wire response.

Re-exports§

pub use loop_core::CommitApplier;
pub use loop_core::RaftLoop;
pub use loop_core::SnapshotQuarantineHook;
pub use loop_core::VShardEnvelopeHandler;

Modules§

handle_rpc
Inbound Raft RPC dispatch — impl RaftRpcHandler for RaftLoop.
join
Server-side JoinRequest orchestration.
loop_core
RaftLoop struct, constructors, top-level run loop, and thin wrappers over MultiRaft proposal APIs. The tick body lives in super::tick; the inbound-RPC handler lives in super::handle_rpc; the async join orchestration lives in super::join.
proposals
Raft proposal API — local and leader-forwarded proposals for both the metadata group (group 0) and data groups.
tick
Single tick of the Raft event loop.