MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / read_committed_entries

Method read_committed_entries

nodedb-cluster/src/multi_raft/core.rs:286–298  ·  view source on GitHub ↗

Read committed log entries for a Raft group in the inclusive index range `[lo, hi]`. `hi` is clamped to the group's `commit_index` so callers that pass `u64::MAX` never read uncommitted entries. Used by the Calvin scheduler's rebuild path to replay sequenced transactions from the sequencer Raft log after a restart. Returns `Err(ClusterError::Raft(RaftError::LogCompacted))` if `lo` has been comp

(
        &self,
        group_id: u64,
        lo: u64,
        hi: u64,
    )

Source from the content-addressed store, hash-verified

284 /// has been compacted into a snapshot (caller must install a snapshot
285 /// instead of replaying from log).
286 pub fn read_committed_entries(
287 &self,
288 group_id: u64,
289 lo: u64,
290 hi: u64,
291 ) -> Result<Vec<nodedb_raft::message::LogEntry>> {
292 let node = self
293 .groups
294 .get(&group_id)
295 .ok_or(ClusterError::GroupNotFound { group_id })?;
296 let entries = node.log_entries_range(lo, hi)?;
297 Ok(entries.to_vec())
298 }
299}
300
301// Re-export LogEntry so callers of `read_committed_entries` can name the type.

Callers

nothing calls this directly

Calls 3

log_entries_rangeMethod · 0.80
getMethod · 0.45
to_vecMethod · 0.45

Tested by

no test coverage detected