Saga Rollback: Half-Succeeded

A saga fails at step 3, triggering compensating actions that undo steps 2 then 1 in reverse order to reach a consistent state

Saga Rollback: Half-Succeeded A saga fails at step 3, triggering compensating actions that undo steps 2 then 1 in reverse order to reach a consistent state 01 / Forward saga EX / Compensation Step 1 · reserve stock · Forward saga · committed Step 1 reserve stock committed Step 2 · charge card · Forward saga · committed Step 2 charge card committed Step 3 · book courier · Forward saga · fails Step 3 book courier fails Undo 2 · refund card · Compensation Undo 2 refund card Undo 1 · release stock · Compensation Undo 1 release stock Consistent · state restored · Compensation · safe Consistent state restored safe step 3 fails undo 2 undo 1 Legend User UI Agent logic Policy Tool action Context / trace

Forward Path

  • • Each step is a local transaction that commits immediately
  • • There is no global lock across the steps
  • • Steps 1 and 2 succeed before step 3 is attempted

Failure at Step 3

  • • Step 3 fails, leaving the saga half-succeeded
  • • Committed work cannot simply be rolled back
  • • Compensation runs in strict reverse order

Back to Consistent

  • • Undo 2 refunds the card charged in step 2
  • • Undo 1 releases the stock reserved in step 1
  • • The system ends in a consistent, well-defined state