Skip to main content

LauncherSagaLog

Struct LauncherSagaLog 

Source
pub struct LauncherSagaLog {
    inner: Mutex<BTreeMap<u64, SagaRecord>>,
}
Expand description

In-memory launcher saga registry. Owned by SagaCoordinator as Arc<LauncherSagaLog> (the name is kept from the durable era to minimize churn at the ~5 coordinator call sites; it IS still a log — an in-memory, bounded one).

Fields§

§inner: Mutex<BTreeMap<u64, SagaRecord>>

Implementations§

Source§

impl LauncherSagaLog

Source

pub fn new() -> Self

Create an empty registry. Infallible — there is no file to open and no schema to migrate.

Source

pub fn open_in_memory() -> Result<Self, LogError>

Compatibility constructor from the durable era (the registry is always in-memory now). Kept so the coordinator’s tests — written against the old API — compile unchanged.

Source

pub fn max_saga_id(&self) -> Result<u64, LogError>

Highest existing saga_id, or 0 if empty. The coordinator seeds next_saga_id from this; for a fresh in-memory registry it is always 0, so saga ids are per-process correlation ids (which is all the host’s idempotency LRU and the pipe’s drop-failure paths ever needed them to be).

Source

pub fn start_saga( &self, saga_id: u64, name: &str, input: &Value, ) -> Result<(), LogError>

Insert a fresh saga in running state. A duplicate saga_id is a bug worth surfacing, not a silent overwrite.

Source

pub fn terminate_saga( &self, saga_id: u64, outcome: SagaOutcome, ) -> Result<(), LogError>

Write a saga’s terminal state. No-op when the saga_id is unknown (mirrors the durable log’s UPDATE-on-missing-row).

Source

pub fn start_step( &self, saga_id: u64, step_index: u32, name: &str, target: PipeTarget, cmd: &Command, ) -> Result<(), LogError>

Record a pending step before its command is dispatched.

Source

pub fn finish_step( &self, saga_id: u64, step_index: u32, output: &Event, ) -> Result<(), LogError>

Mark a step succeeded and store the awaited event as JSON.

Source

pub fn mark_failed_compensation( &self, saga_id: u64, reason: &str, ) -> Result<(), LogError>

Mark a saga failed_compensation. Idempotent; preserves any existing failure_reason by APPENDING the new reason (post-mortem preservation, codex P2 PR #647 round 1). No-op on unknown id. Retained for API parity + diagnostics even though the recovery walker that was its sole production caller is gone.

Source

fn enforce_retention(inner: &mut BTreeMap<u64, SagaRecord>)

Evict the oldest TERMINAL sagas beyond the retention cap. In-flight sagas are never evicted (they’d vanish from diagnostics mid-run and their terminal write would silently no-op). Replaces the durable log’s vacuum_older_than.

Source

fn step_mut<'a>( inner: &'a mut BTreeMap<u64, SagaRecord>, saga_id: u64, step_index: u32, ) -> Option<&'a mut StepRecord>

Trait Implementations§

Source§

impl Default for LauncherSagaLog

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more