pub struct PostgresFaultState { /* private fields */ }Expand description
Durable PostgreSQL retry-reservation state for one step execution.
A reservation is one short metadata-only transaction that runs after a known rollback and before backoff. It reads the retained state under a row lock, requires the supplied ordinal to follow the persisted one, and advances the phase retry count, the acknowledged rollback count, and the retained envelope with an optimistic version check. A stale or concurrent writer loses instead of spending the same ordinal twice.
The retained state is cleared by the enlisted chunk commit, because the commit that advances the checkpoint supersedes the whole generation.
Implementations§
Source§impl PostgresFaultState
impl PostgresFaultState
Sourcepub fn new(repository: PostgresJobRepository, policy: &FaultPolicy) -> Self
pub fn new(repository: PostgresJobRepository, policy: &FaultPolicy) -> Self
Constructs durable state for the step that installs policy.
The runtime binds the step execution before the first chunk attempt.
Trait Implementations§
Source§impl Debug for PostgresFaultState
impl Debug for PostgresFaultState
Source§impl FaultStateStore for PostgresFaultState
impl FaultStateStore for PostgresFaultState
Source§fn bind(
&self,
context: ChunkTransactionContext,
) -> BoxFuture<'_, Result<(), FaultStateError>>
fn bind( &self, context: ChunkTransactionContext, ) -> BoxFuture<'_, Result<(), FaultStateError>>
Source§fn reserved_ordinal(
&self,
key: RetryKey,
) -> BoxFuture<'_, Result<Option<RetryOrdinal>, FaultStateError>>
fn reserved_ordinal( &self, key: RetryKey, ) -> BoxFuture<'_, Result<Option<RetryOrdinal>, FaultStateError>>
key, when one exists.Source§fn reserve(
&self,
reservation: RetryReservation,
) -> BoxFuture<'_, Result<(), FaultStateError>>
fn reserve( &self, reservation: RetryReservation, ) -> BoxFuture<'_, Result<(), FaultStateError>>
Source§fn resolve(&self, _key: RetryKey) -> BoxFuture<'_, Result<(), FaultStateError>>
fn resolve(&self, _key: RetryKey) -> BoxFuture<'_, Result<(), FaultStateError>>
key resolved because its unit of work succeeded or was skipped. Read moreSource§fn clear_resolved(&self) -> BoxFuture<'_, Result<(), FaultStateError>>
fn clear_resolved(&self) -> BoxFuture<'_, Result<(), FaultStateError>>
Source§fn unresolved(&self) -> BoxFuture<'_, Result<u32, FaultStateError>>
fn unresolved(&self) -> BoxFuture<'_, Result<u32, FaultStateError>>
Auto Trait Implementations§
impl !Freeze for PostgresFaultState
impl !RefUnwindSafe for PostgresFaultState
impl !UnwindSafe for PostgresFaultState
impl Send for PostgresFaultState
impl Sync for PostgresFaultState
impl Unpin for PostgresFaultState
impl UnsafeUnpin for PostgresFaultState
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
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