OxL Справочник OxL
РусскийEnglish

error saga-idempotency

error Стандарт: [§11.3]

Вызов rpc без `@idempotent` в шаге или компенсации саги.

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✓ проверяется в 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 · Версия документации 1.0.0-beta© OxwaldLink · сгенерировано из Стандарта, исходников std и руководства