Compensating transaction.
also: compensating transactions · compensation · compensations · compensating action · compensating actionsA new transaction that semantically undoes an earlier saga step, such as refunding a charge, since a committed step can't be rolled back.
the two-minute refresher
- A rollback erases changes as if they never happened; a compensation adds a reversing change.
- Charge → refund, reserve stock → release stock, book → cancel.
- Some effects can't be undone (an email was sent): compensate with a follow-up.
- Compensations must be idempotent and retried until they succeed.