From 1a0a0e7958586a609ea4f197d4c40d92d791822d Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 10 Sep 2026 22:28:48 +0200 Subject: [PATCH] Observe the candidate before waiting on Odin's evidence in AwaitingReady, Routing, and Committing A candidate that died while its correlation was pending was never observed again: each phase returned on no-evidence-yet every tick, the error that triggers the post-fencing abort never happened, and the transaction owned the target forever behind a process that was gone. Seen on yggdrasil with a continuity transaction parked in Committing across the projection-key migration. Verified with cargo test --lib in rust:1.95-bookworm on yggdrasil: 114 passed. Co-Authored-By: Claude Fable 5.1 --- src/control_plane.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/control_plane.rs b/src/control_plane.rs index 83a06b6..c34a1b7 100644 --- a/src/control_plane.rs +++ b/src/control_plane.rs @@ -4103,6 +4103,7 @@ impl Engine { fn advance_awaiting_ready(&self, current: &Stored) -> Result<()> { let now = now_millis()?; let expected = required(¤t.value.expected, "Expected projection")?; + self.observe_candidate_before_waiting(¤t.value)?; if expected.write_lease_required { let activation = required(¤t.value.activation, "activation")?; let warming = self.rehydrate_warming_token(¤t.value, now, false)?; @@ -4166,6 +4167,7 @@ impl Engine { fn advance_routing(&self, current: &Stored) -> Result<()> { let expected = required(¤t.value.expected, "Expected projection")?; let activation = required(¤t.value.activation, "activation")?; + self.observe_candidate_before_waiting(¤t.value)?; if current.value.routing.is_none() { let current_lease = current .value @@ -4275,6 +4277,7 @@ impl Engine { } fn advance_committing(&self, current: &Stored) -> Result<()> { + self.observe_candidate_before_waiting(¤t.value)?; let current_lease_sha256 = current .value .leasing @@ -4747,6 +4750,22 @@ impl Engine { } } + /// A phase that waits on Odin's evidence about the candidate must first + /// confirm the candidate still exists. Otherwise a candidate that died + /// while its correlation was pending is never observed again: the phase + /// returns early on "no evidence yet" every tick, the error that would have + /// triggered the post-fencing abort never happens, and the transaction + /// owns the target forever behind a process that is gone. + fn observe_candidate_before_waiting(&self, transaction: &DeploymentTransaction) -> Result<()> { + self.workload + .observe( + required(&transaction.expected, "Expected projection")?, + required(&transaction.activation, "activation")?, + required(&transaction.workload, "candidate workload")?, + ) + .map(|_| ()) + } + /// The lifecycle brake as it applies to restarting one admitted /// generation: the same evaluation `lifecycle_allows` makes for a /// continuity transaction, asked before one is minted.