Skip to main content

build_snapshot

Function build_snapshot 

Source
pub fn build_snapshot(
    ctx: &EngineCtx,
    checkpoint: &WalCheckpointMetadata,
) -> EngineStateSnapshot
Expand description

Build a snapshot from current engine state, tagged with the checkpoint boundary.

Critical: last_command_id and last_l2_seq come from the WAL checkpoint (the Postgres-replicated boundary), NOT from the live engine. This ensures that delta replay on the next restart queries Postgres starting from a point where all commands have been replicated.