Expand description
Saga / compensation pattern operations.
Implement the saga pattern for distributed transaction rollback:
DurableContext::step_with_compensation— execute a forward step and, on success, register a type-erased compensation closure that can reverse it.DurableContext::run_compensations— execute all registered compensations in reverse registration order (LIFO — last registered, first executed), checkpointing each one withContext/START + Context/SUCCEED|FAILusingsub_type = "Compensation". All compensations are attempted regardless of earlier failures (continue-on-error semantics).
§Checkpoint Protocol
Each compensation checkpoint mirrors the child_context pattern:
OperationType::Context+OperationAction::Start+sub_type = "Compensation"OperationType::Context+OperationAction::Succeed+sub_type = "Compensation"- or
OperationType::Context+OperationAction::Failon error
§Replay / Partial Rollback Resume
During replay, completed compensations (Succeeded or Failed in history) are skipped — their outcome is read from history. This enables partial rollback resume: if a Lambda times out mid-compensation, the next invocation replays the completed ones and continues from the first incomplete one.