OxL Reference

error saga-idempotency

error Standard: [§11.3]

What it means#

A saga step and its compensation can run again after a failure or a takeover, with the key sagaId#step. The rpcs they call must be @idempotent, otherwise the repetition would do the work twice (charge a card twice).

Example#

oxl✓ checked in CI
service Payments { rpc charge(n: u64) -> u64 }
impl Payments { rpc charge(n) => n }
saga pay(n: u64) -> u64 {
  Payments.charge(n)   // <- saga-idempotency
}
error
saga-idempotency

How to fix#

Mark the rpc @idempotent (and make it return its first answer for a repeated key), or call it outside the saga.

See also#

OxL 1.0.0-beta · Documentation version 1.0.0-beta© OxwaldLink · generated from the Standard, the std sources and the guides