class
Raft::Node::Replicator
- Raft::Node::Replicator
- Reference
- Object
Overview
Per-peer log replication fiber with pipelined AppendEntries.
Each replicator runs in its own fiber and sends AppendEntries RPCs to a
single follower. It maintains an optimistic @pipeline_next_index cursor
that can run ahead of the confirmed @next_index, allowing up to
Config#max_inflight_rpcs batches to be in-flight simultaneously. The
leader event loop signals each ack back via #ack so the replicator can
send the next batch without waiting for the heartbeat timeout.
When the follower is too far behind, the replicator sends the snapshot in
chunks via InstallSnapshot and resets the pipeline cursor.
Defined in:
raft/node/replicator.crConstructors
Instance Method Summary
-
#ack(success : Bool) : Nil
Called by the leader event loop after each
AppendEntriesResponse. - #notify : Nil
- #start : Nil
- #stop : Nil
Constructor Detail
Instance Method Detail
Called by the leader event loop after each AppendEntriesResponse.
success false resets the pipeline cursor to the last confirmed position.