From 4a30d0295cf6018f804e56ea5e27257d9a3b7be9 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 8 Sep 2026 15:21:20 +0200 Subject: [PATCH] R23.3: post-fencing advance errors abort, not retry forever verify_resident_deployment_authorization's own doc comment already promised that a failure aborts the transaction through the pre-/post- fencing abort path for any advance error. The pre-fencing side already did that unconditionally. The post-fencing side did not: it only called begin_post_fencing_abort when candidate_is_permanently_stopped, and otherwise fell through to record_resumable_error forever. A rotated brake operator identity, or a Complete record whose post- commit cleanup can never re-authorize, wedged the target permanently with its incumbent fenced (or its cleanup pending) and no path off that state -- blocking new target mutation forever, since blocks_new_target_mutation is true for exactly this state. Drop the permanently-stopped gate so a post-fencing advance error aborts on its first occurrence, same as a pre-fencing one, and delete candidate_is_permanently_stopped now that its only caller is gone. The code now matches what its own doc comment already claimed (R3). Co-Authored-By: Claude Opus 5 --- src/control_plane.rs | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/control_plane.rs b/src/control_plane.rs index 60a0b9d..4aeb91f 100644 --- a/src/control_plane.rs +++ b/src/control_plane.rs @@ -2881,14 +2881,20 @@ impl Engine { && latest.value.pre_fencing_abort.is_none() { self.begin_pre_fencing_abort(latest, error)?; - } else if latest.value.post_fencing_abort.is_none() - && self.candidate_is_permanently_stopped(&latest.value)? - { - // Past the fence an error is resumable while the candidate - // can still recover. This one cannot: its transient unit - // has failed and carries Restart=no, so retrying would hold - // the target forever behind a transaction that can never - // finish. + } else if latest.value.post_fencing_abort.is_none() { + // R23.3: an advance error at or after Fencing aborts, + // same as one before it -- this function's own doc + // comment already promised that (see + // verify_resident_deployment_authorization). Gating the + // abort on "is the candidate permanently stopped" left + // every other post-fencing failure, including a rotated + // brake operator identity or a Complete record whose + // post-commit cleanup can never re-authorize, retrying + // record_resumable_error forever: the target wedged with + // its incumbent fenced (or its cleanup pending) and no + // path off that state. There is no cheaper fence-side + // candidate to recover than the one that already stopped + // taking traffic when it was fenced. self.begin_post_fencing_abort(latest, error)?; } else { self.record_resumable_error(latest, &error)?; @@ -5364,17 +5370,6 @@ impl Engine { }) } - /// Whether this transaction's candidate can no longer run at all. - /// - /// A transaction that has never started one has no candidate to be dead, so - /// it is not permanently stopped -- it is simply not there yet. - fn candidate_is_permanently_stopped(&self, transaction: &DeploymentTransaction) -> Result { - let Some(workload) = &transaction.workload else { - return Ok(false); - }; - self.workload.is_permanently_stopped(workload) - } - fn begin_post_fencing_abort( &self, current: &Stored,