pub enum Event {
Tick {
now: Tick,
},
ReadIndex {
request_id: u64,
key: Vec<u8>,
},
Propose {
client_id: ClientId,
seq: u64,
payload: Vec<u8>,
},
ProposeConfig {
change: ConfigChange,
},
SnapshotLoaded {
meta: SnapshotMeta,
data: Vec<u8>,
},
SnapshotPersisted {
meta: SnapshotMeta,
},
Message {
from: NodeId,
msg: Message,
},
Persisted {
kind: PersistKind,
up_to_index: LogIndex,
},
Restored {
hard_state: HardState,
entries: Vec<LogEntry>,
snapshot: Option<SnapshotMeta>,
},
}Expand description
One input to Node::step.
Variants§
Tick
The driver’s clock reached now. The core compares this against
its own deadlines; it never reads any other clock.
ReadIndex
A client asks the leader for a linearizable read of key.
The core runs the ReadIndex protocol (docs/ARCHITECTURE.md
section 8) and answers with Action::ReadReady once the read is
safe to serve, or Action::ReadRejected when this node cannot
serve it. The key is carried opaquely; the value lives in the
state machine, not the core.
Propose
A client proposes a command to this node.
Fields
ProposeConfig
An operator proposes a single-server membership change
(docs/ARCHITECTURE.md section 9). The leader answers with
Action::ConfigResponse: immediately when the change is
rejected, and when the config entry commits when it is
accepted.
Fields
change: ConfigChangeThe change being proposed.
SnapshotLoaded
The driver loaded this node’s snapshot payload from its state machine, either for the node’s own log compaction or because the node leads and a follower needs the snapshot relayed. The core holds the bytes until every lagging follower has passed the snapshot base.
Fields
meta: SnapshotMetaThe snapshot’s identity.
SnapshotPersisted
A snapshot the driver was asked to persist (its own, received over the wire and assembled, or relayed) is now durable. Only on this acknowledgment does the core install the snapshot: advance the log base, retain or discard the log per the prefix rule, and jump the apply cursor (invariant T-02 applied to snapshots).
Fields
meta: SnapshotMetaThe persisted snapshot’s identity.
Message
An RPC message arrived from another node.
Persisted
A durable write the driver was asked to perform has completed. Dependent responses are released only when this arrives (invariant T-02).
Fields
kind: PersistKindWhich write completed.
Restored
The node restarted; this is its recovered durable state. Sent by the driver as the first event after construction when restarting a crashed node.
Fields
entries: Vec<LogEntry>The recovered durable log entries above the snapshot
boundary, in index order: every durable entry when
snapshot is None, and only the entries the
snapshot does not cover when it is present (invariant
N-08). A store never returns covered entries at
restore.
snapshot: Option<SnapshotMeta>The recovered durable snapshot’s boundary, when the storage layer holds one whose payload the driver has verified and installed into its state machine. The core installs the boundary at restore (invariant N-07): without it a restarted node’s base never reflects its snapshot, and the recovered suffix is replayed at the wrong indexes.