error saga-idempotency
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#
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.