Archive verified rollbacks of interrupted activation journals
ABSDEV Framework CI / framework-ci (push) Successful in 20s

This commit is contained in:
Mark Gregory
2026-11-30 12:37:34 +00:00
parent 054c546c8f
commit 611f8d0f3d
5 changed files with 55 additions and 11 deletions
+4 -5
View File
@@ -11,6 +11,9 @@ from core.compatibility import (
from core.locking import DeploymentLock
ROLLBACK_ELIGIBLE_PHASES = frozenset({"ACTIVATING", "ACTIVATED", "FAILED"})
class RecoveryError(RuntimeError):
"""Recovery safety could not be established."""
@@ -140,11 +143,7 @@ class RecoveryPlanner:
)
require(
transaction["phase"] in (
"ACTIVATING",
"ACTIVATED",
"FAILED",
),
transaction["phase"] in ROLLBACK_ELIGIBLE_PHASES,
"Transaction phase does not permit rollback review",
)
+6 -4
View File
@@ -18,6 +18,7 @@ from core.compatibility import (
validate_provenance,
)
from core.locking import DeploymentLock
from core.recovery import ROLLBACK_ELIGIBLE_PHASES
class RollbackArchiveReader:
@@ -65,10 +66,10 @@ class RollbackArchiveReader:
)
require(
transaction["phase"] == "FAILED"
transaction["phase"] in ROLLBACK_ELIGIBLE_PHASES
and intent["status"] == "ROLLBACK_INTENT"
and result["status"] == "ROLLED_BACK",
"Completed failed-transaction rollback required",
"Completed rollback of a failed or interrupted activation required",
)
phases = {
@@ -195,9 +196,9 @@ class RollbackArchive(RollbackArchiveReader):
require(
transaction is not None
and transaction["phase"] == "FAILED"
and transaction["phase"] in ROLLBACK_ELIGIBLE_PHASES
and transaction["site"] == self.planner.site,
"Failed deployment transaction required",
"Failed or interrupted deployment transaction required",
)
identifier = transaction["transaction_id"]
@@ -339,6 +340,7 @@ class RollbackArchive(RollbackArchiveReader):
) from None
def _execute(self, confirmation, fingerprint):
self.journal.require_writes_allowed()
plan = self._plan()
require(