fix(correction): implement actual undo logic in _rollback_completed_actions to restore atomic cascade guarantee #9435
@@ -400,11 +400,21 @@ class CrossPlanCorrectionService:
|
||||
Best-effort: errors during undo are logged but do not prevent
|
||||
other rollbacks from being attempted.
|
||||
|
||||
When a cascade action fails partway through, this method is called
|
||||
in reverse order to clean up any state already modified by
|
||||
previously completed actions. For actions that rolled back a
|
||||
sandbox, the sandbox is re-rolled-back (idempotent) to ensure it
|
||||
is left in a clean state; otherwise a log entry is produced.
|
||||
|
||||
Args:
|
||||
completed_actions: Actions that were successfully executed.
|
||||
"""
|
||||
for action in reversed(completed_actions):
|
||||
try:
|
||||
if action.sandbox_rolled_back:
|
||||
self._sandbox_rollbacker.rollback_child_plan_sandbox(
|
||||
action.child_plan_id
|
||||
)
|
||||
logger.info(
|
||||
"cross_plan_correction.rollback_action",
|
||||
child_plan_id=action.child_plan_id,
|
||||
|
||||
Reference in New Issue
Block a user