pub struct Checkpoint {
pub last_completed_step: Option<String>,
pub completed_steps: Vec<String>,
pub in_progress_step: Option<String>,
pub cursor_step: Option<String>,
pub cursor: Option<Vec<u8>>,
pub schema_version: u32,
pub step_set_hash: String,
pub crashes_by_step: Vec<(String, u32)>,
}Expand description
Progress within a single job. Persisted with the lease renewal that is already happening, so a mid-step crash does not lose it — River’s default writes this only after the worker returns, which is the one case it is needed.
Fields§
§last_completed_step: Option<String>§completed_steps: Vec<String>The completed steps IN ORDER. Replay compares positionally: the step at index i
of the new attempt must match completed_steps[i], or the step set changed under
the checkpoint and the job goes to undecodable — never a silent restart.
in_progress_step: Option<String>crash quarantine the step that was running when the checkpoint was last written. Written BEFORE the step’s side effects; the reclaimer attributes a crash to it.
cursor_step: Option<String>§cursor: Option<Vec<u8>>§schema_version: u32payload versioning × step replay — the step set this checkpoint was written against.
step_set_hash: String§crashes_by_step: Vec<(String, u32)>crash quarantine crash counts per step. “Always dies at transcode” beats “dies”.
Implementations§
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn resumability(
&self,
current_version: u32,
current_step_set_hash: &str,
) -> Resume
pub fn resumability( &self, current_version: u32, current_step_set_hash: &str, ) -> Resume
Decide how (or whether) a job may resume. The conservative branch is the default: an unrecognized step set never silently restarts from step one.
Trait Implementations§
Source§impl Clone for Checkpoint
impl Clone for Checkpoint
Source§fn clone(&self) -> Checkpoint
fn clone(&self) -> Checkpoint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more