pub enum Action {
Send {
to: NodeId,
msg: Message,
},
PersistHardState {
current_term: Term,
voted_for: Option<NodeId>,
},
PersistEntries {
from_index: LogIndex,
entries: Vec<LogEntry>,
},
Apply {
index: LogIndex,
entry: LogEntry,
},
ReadReady {
request_id: u64,
key: Vec<u8>,
read_index: LogIndex,
},
ReadRejected {
request_id: u64,
leader: Option<NodeId>,
},
ClientResponse {
client_id: ClientId,
seq: u64,
result: ClientResult,
},
PersistSnapshot {
meta: SnapshotMeta,
data: Vec<u8>,
},
LoadSnapshot {
meta: SnapshotMeta,
},
ConfigResponse {
change: ConfigChange,
result: ConfigResult,
},
StepDown {
term: Term,
},
}Expand description
One output of Node::step.
Variants§
Send
Send an RPC message to a peer.
PersistHardState
Persist the hard state (current term and voted-for) before any response that depends on it is released.
PersistEntries
Persist log entries. Storage semantics: truncate the durable log
to from_index - 1, then store entries at consecutive indexes
starting at from_index.
Fields
Apply
Apply the committed entry at index to the state machine.
Applies are emitted in index order, exactly once per index per
node lifetime.
ReadReady
A ReadIndex read is confirmed linearizable. The driver serves
the value of key from its state machine once its applied index
reaches read_index, and must not serve a newer-or-older value.
Fields
ReadRejected
A ReadIndex read cannot be served by this node (it is not the
leader, or it stopped being the leader mid-round).
Fields
ClientResponse
Answer a client proposal.
Fields
result: ClientResultThe outcome.
PersistSnapshot
Persist a fully assembled snapshot payload (received over the
wire, or this node’s own once loaded) before the core installs
it. The matching Event::SnapshotPersisted releases the
install.
Fields
meta: SnapshotMetaThe snapshot’s identity.
LoadSnapshot
The core needs this node’s snapshot payload (its log base has
advanced past entries a follower still needs, or the driver
asked for compaction headroom). The driver answers with
Event::SnapshotLoaded.
Fields
meta: SnapshotMetaThe identity of the snapshot to load.
ConfigResponse
Answer a membership change proposal.
StepDown
This node was a leader and stepped down on discovering a higher term. Drivers use it to fail in-flight leader work promptly.