pub struct ClaimedRunRecovery<'store> { /* private fields */ }Expand description
Fence-bound, corruption-quarantining read surface for one claimed run.
A session is created only after the database confirms the exact live
RunFence, runnable projection, tenant/run scope, and journal observation.
Every recovery read exposed here maps durable StoreError::CorruptData
through one stable CorruptionQuarantineContext. Ordinary availability,
cursor, contention, and stale-observation failures never quarantine.
The initial snapshot is evidence about the recovery starting point, not an
authorization to perform external I/O. Manual page consumers call
Self::revalidate before handing recovered work to a durable start API.
Self::plan_ready_nodes performs that final revalidation itself, and
PostgresStore::start_recovered_node_attempt remains the authoritative
transactional dispatch fence.
Implementations§
Source§impl ClaimedRunRecovery<'_>
impl ClaimedRunRecovery<'_>
Sourcepub const fn fence(&self) -> &RunFence
pub const fn fence(&self) -> &RunFence
Returns the exact worker fence validated when this session was created.
Sourcepub const fn quarantine_context(&self) -> &CorruptionQuarantineContext
pub const fn quarantine_context(&self) -> &CorruptionQuarantineContext
Returns the stable corruption evidence intent used by every read.
Sourcepub const fn initial_run(&self) -> &StoredRun
pub const fn initial_run(&self) -> &StoredRun
Returns the fully validated run snapshot observed at session creation.
Sourcepub const fn initial_observed_at(&self) -> Timestamp
pub const fn initial_observed_at(&self) -> Timestamp
Returns the database clock observed atomically with the initial run and live-fence validation.
Sourcepub async fn revalidate(&self) -> Result<StoredRun, StoreError>
pub async fn revalidate(&self) -> Result<StoredRun, StoreError>
Rechecks the live fence, runnable projection, and exact journal head.
Recovery callers should invoke this after consuming their bounded pages and before preparing any durable dispatch attempt. A lease renewal under the same fence is accepted; expiry, supersession, quarantine, lifecycle removal, or journal progress aborts the handoff explicitly.
§Errors
Returns fencing, lifecycle, stale-observation, corruption/quarantine, or database failures. Corruption is quarantined before this method returns.
Sourcepub async fn load_pinned_graph(
&self,
) -> Result<StoredGraphDefinition, StoreError>
pub async fn load_pinned_graph( &self, ) -> Result<StoredGraphDefinition, StoreError>
Loads the exact compiled graph pinned by this recovery checkpoint.
The method revalidates the live fence and journal observation both before and after loading the immutable checkpoint and tenant registry row. It recompiles the canonical definition, verifies its digest and owner-qualified identity, and rejects unknown ready nodes or an initial ready set that differs from the compiled entry set.
§Errors
Returns StoreError::ReadyNodeRecoveryCheckpointMissing before an
initial checkpoint exists. A missing, mismatched, or corrupt pinned
definition is quarantined before returning StoreError::RunQuarantined.
Sourcepub async fn validate_noninitial_replay<V, R>(
&self,
schemas: &V,
reducer: &R,
limits: GraphReplayLimits,
) -> Result<GraphReplayReport, StoreError>
pub async fn validate_noninitial_replay<V, R>( &self, schemas: &V, reducer: &R, limits: GraphReplayLimits, ) -> Result<GraphReplayReport, StoreError>
Independently replays every committed noninitial checkpoint transition.
Lineage pages are streamed newest-to-oldest while retaining only the current child. For each parent, the provider reloads every exact pending result and its consumption row in one repeatable-read transaction, enforces the configured compact-byte ceiling, then closes that transaction before invoking the schema registry or reducer. The graph planner is given the already committed child’s checkpoint ID and its derived successor write must match every semantic child field.
A schema/reducer that is unavailable, panics, or cannot satisfy its local resource bound is an operational deployment failure and does not quarantine durable data. Missing results, invalid consumption rows, rejected durable values, nondeterministic state/routing, and any other parent-to-child mismatch are payload-redacted corruption and trigger the session’s exact fence-protected quarantine before this method returns. A final snapshot revalidates the original journal observation, current checkpoint pointer, runnable lifecycle, and live fence.
§Errors
Returns StoreError::ReadyNodeRecoveryCheckpointMissing before an
initial checkpoint, StoreError::GraphReplayDependencyUnavailable for
missing or failed executable dependencies,
StoreError::GraphReplayResourceLimit when one barrier exceeds
limits, ordinary fencing/database/staleness errors, or
StoreError::RunQuarantined after a durable replay mismatch is
isolated.
Sourcepub async fn plan_ready_nodes(
&self,
) -> Result<ReadyNodeRecoveryPlan, StoreError>
pub async fn plan_ready_nodes( &self, ) -> Result<ReadyNodeRecoveryPlan, StoreError>
Reconstructs the exact current checkpoint ready set into one deterministic, database-time recovery plan.
The provider loads the immutable checkpoint pinned when this session began, streams fully verified unconsumed results in bounded pages, then streams every ready activation’s complete physical-attempt history. A final database snapshot revalidates the exact journal observation and live fence before classifying fresh work, crash takeover, delayed retry, same-fence in-flight work, terminal failure, attempt exhaustion, or barrier-ready reuse.
The returned plan is not dispatch authority. Hand each selected node to
PostgresStore::start_recovered_node_attempt; that API binds the plan
to an exact worker append and repeats the decisive checkpoint, latest
history transition, database-clock retry, journal, lifecycle, and
live-fence checks.
§Errors
Returns StoreError::ReadyNodeRecoveryCheckpointMissing before the
run has an initial checkpoint. Cursor, availability, lifecycle, or
fencing races are explicit and do not quarantine. Any durable
checkpoint/result/attempt contradiction is converted to payload-redacted
corruption and fenced quarantine before return.
Sourcepub async fn load_checkpoint_lineage_page(
&self,
from: Option<&CheckpointHead>,
page_size: CheckpointLineagePageSize,
) -> Result<CheckpointLineagePage, StoreError>
pub async fn load_checkpoint_lineage_page( &self, from: Option<&CheckpointHead>, page_size: CheckpointLineagePageSize, ) -> Result<CheckpointLineagePage, StoreError>
Loads one bounded current checkpoint-lineage page through quarantine.
§Errors
Returns the underlying cursor, durable-state, fencing-independent read, quarantine, or database failure. Corruption is quarantined first.
Sourcepub async fn load_journal_page(
&self,
after: Option<&JournalHead>,
page_size: JournalPageSize,
) -> Result<JournalPage, StoreError>
pub async fn load_journal_page( &self, after: Option<&JournalHead>, page_size: JournalPageSize, ) -> Result<JournalPage, StoreError>
Loads one bounded journal page through quarantine.
§Errors
Returns the underlying cursor, durable-state, quarantine, or database failure. Corruption is quarantined first.
Sourcepub async fn load_tool_invocation_history_page(
&self,
invocation_id: InvocationId,
after: Option<&ToolInvocation>,
page_size: ToolInvocationHistoryPageSize,
) -> Result<ToolInvocationHistoryPage, StoreError>
pub async fn load_tool_invocation_history_page( &self, invocation_id: InvocationId, after: Option<&ToolInvocation>, page_size: ToolInvocationHistoryPageSize, ) -> Result<ToolInvocationHistoryPage, StoreError>
Loads one bounded tool-invocation history page through quarantine.
§Errors
Returns the underlying not-found, cursor, durable-state, quarantine, or database failure. Corruption is quarantined first.
Sourcepub async fn load_model_invocation_history_page(
&self,
invocation_id: InvocationId,
after: Option<&ModelInvocation>,
page_size: ModelInvocationHistoryPageSize,
) -> Result<ModelInvocationHistoryPage, StoreError>
pub async fn load_model_invocation_history_page( &self, invocation_id: InvocationId, after: Option<&ModelInvocation>, page_size: ModelInvocationHistoryPageSize, ) -> Result<ModelInvocationHistoryPage, StoreError>
Loads one bounded model-invocation history page through quarantine.
§Errors
Returns the underlying not-found, cursor, durable-state, quarantine, or database failure. Corruption is quarantined first.
Sourcepub async fn load_node_attempt_history_page(
&self,
activation: &NodeActivation,
cursor: Option<&NodeAttempt>,
page_size: NodeAttemptHistoryPageSize,
) -> Result<NodeAttemptHistoryPage, StoreError>
pub async fn load_node_attempt_history_page( &self, activation: &NodeActivation, cursor: Option<&NodeAttempt>, page_size: NodeAttemptHistoryPageSize, ) -> Result<NodeAttemptHistoryPage, StoreError>
Loads one bounded physical node-attempt history page through quarantine.
§Errors
Returns StoreError::InvalidClaimedRunRecoveryContext when the
activation crosses this session, otherwise the underlying cursor,
durable-state, quarantine, or database failure.
Sourcepub async fn load_unconsumed_pending_node_result_page(
&self,
base: &CheckpointHead,
cursor: Option<&PendingNodeResultPageCursor>,
page_size: PendingNodeResultPageSize,
) -> Result<PendingNodeResultPage, StoreError>
pub async fn load_unconsumed_pending_node_result_page( &self, base: &CheckpointHead, cursor: Option<&PendingNodeResultPageCursor>, page_size: PendingNodeResultPageSize, ) -> Result<PendingNodeResultPage, StoreError>
Loads one bounded page of unconsumed node results through quarantine.
§Errors
Returns StoreError::InvalidClaimedRunRecoveryContext when the base
checkpoint crosses this session, otherwise the underlying cursor,
durable-state, quarantine, or database failure.
Auto Trait Implementations§
impl<'store> !RefUnwindSafe for ClaimedRunRecovery<'store>
impl<'store> !UnwindSafe for ClaimedRunRecovery<'store>
impl<'store> Forget for ClaimedRunRecovery<'store>
impl<'store> Freeze for ClaimedRunRecovery<'store>
impl<'store> Move for ClaimedRunRecovery<'store>
impl<'store> Send for ClaimedRunRecovery<'store>
impl<'store> Sync for ClaimedRunRecovery<'store>
impl<'store> Unpin for ClaimedRunRecovery<'store>
impl<'store> UnsafeUnpin for ClaimedRunRecovery<'store>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more