fix: say when a release command never started (#511 F11 round 3)
Fix round 3 of Task 3F, after the Astra re-review. The box now keeps its own evidence of each release attempt it moves to releasing: a mark in its failure book (attempt ID and term) saved before the releasing write, with Started saved just before the exec. When it later closes, or in the same call ends, a releasing attempt it wrote and never started, the record still closes as unknown, but the message says the release command did not start, the attempt is closed, and a deploy retries it (SR-4-C59). A later adoption of that closed attempt says the same and still holds the deploy. Neither grows a resident's backoff. "Result unknown" stays only when this box started the command, or has no mark for the attempt and cannot tell. A mark that cannot be saved takes no step (SR-4-C60). Census overlay stateless-replicas-4-task3f re-proposed over all rounds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/notes/census-proposal-stateless-replicas-4-task3f.md+13 −3docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md+2 −0internal/activator/activator.go+9 −3internal/activator/stateless_holdwake_test.go+106 −0internal/activator/statelessrelease.go+81 −0internal/activator/swap.go+8 −5internal/host/rollout.go+1 −0internal/host/rolloutdeclined.go+1 −0internal/host/stagerelay.go+1 −0internal/provision/testdata/plan14-root-reads-chain.tsv+1 −1internal/provision/testdata/plan14-root-reads-stateless-replicas-4-task3f.tsv+16 −8internal/replicas/types.go+13 −0internal/rollout/failures.go+57 −3internal/rollout/replica_release_mark_test.go+48 −0
CI failed — run details
Intent
<task-notification> <task-id>a5315a07ea5309511</task-id> <tool-use-id>toolu_01Xp8KroAdMNyzeVyVdjMgoi</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/72128d15-58b8-452f-9f7e-8e864e8854d2/tasks/a5315a07ea5309511.output</output-file> <status>completed</status> <summary>Agent "Implement Plan 4 Task 3F (F11)" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>- **Status:** DONE - **Commit:** `fa314626 fix: say only what is known when a release step fails (#511 F11 r2)`, on top of `0abaa0c0` and `8e0e9eab`. Local only, not pushed. - **What changed:** - Close-path failures no longer claim an unknown result. A term lost on the close reads as SR-4-C56. A lost reply, an older console's bare 409 or any other close failure reads as SR-4-C57. A failed `releasing` write before the exec, which used to read as unknown, now maps the same way. None of these counts toward resident backoff. - `ErrReplicaReleaseUnknown` now appears only where a release command's result is unknown: an open release record on this box, a successful close of this attempt, and failures after the command ran. - An unreachable console keeps its own error ("console unreachable", the approved SR-1-C14), so it backs off as it did before this task. - SR-4-C58 now reads "the instance's route row no longer matches the one this start was prepared against, so nothing started". - **Tests:** the new `TestReplicaReleaseStepFailuresSayWhatIsKnown` failed in all 5 cases against round 1's code and passes now; each case checks the error, the wording and the backoff. Targeted activator, host, root and provision tests pass, as do the grouproll and region HA guards, all three cross-builds, vet and gofmt. - **Census:** I re-proposed `stateless-replicas-4-task3f` over all three rounds; the seal moved bd253671 → 8c7ae110, and `make census-card` reports clean. - **Mutation (not run):** I'd delete the `ErrConsoleUnreachable` case in `stepError`; the console-unreachable subtest should then fail. - **Concerns:** none blocking. SR-4-C55 to C58 still need Paul's copy review. The round 1 note about the `/tmp/g` test dir I couldn't attribute still stands. - **Report:** `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/stateless-replicas-4/.superpowers/sdd/2026-11-01-stateless-replicas-4-deploy-and-drill/task-3F-report.md` (fix round 2 appended)</result> <usage><subagent_tokens>428509</subagent_tokens><tool_uses>15</tool_uses><duration_ms>790833</duration_ms></usage> </task-notification>
<task-notification> <task-id>bq3xqh0zj</task-id> <tool-use-id>toolu_014MzPtSUaKGuSM24zE4UbWp</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/72128d15-58b8-452f-9f7e-8e864e8854d2/tasks/bq3xqh0zj.output</output-file> <status>completed</status> <summary>Background command "Astra re-review of F11 round 2" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 51.6 g CO₂e (6,488,874 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on stateless-replicas-4, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/docs/superpowers/notes/census-proposal-stateless-replicas-4-task3f.md b/docs/superpowers/notes/census-proposal-stateless-replicas-4-task3f.md| index 925d0beef..af356b6de 100644 |
| --- a/docs/superpowers/notes/census-proposal-stateless-replicas-4-task3f.md |
| +++ b/docs/superpowers/notes/census-proposal-stateless-replicas-4-task3f.md |
| @@ -4,17 +4,27 @@ Ruling `census-ruling-stateless-replicas-4-task3f`. The independent reviewer app |
| | unit | change | read sites | what changed | |
| |---|---|---|---| |
| +| `internal/activator/activator.go` `type Service` | body | unchanged (0) | Task 3F fix round 3 (#511 F11): two hook fields, MarkReplicaRelease and ReplicaReleaseMark (the failure book's per-host release mark on this box's disk). No read site. | |
| | `internal/activator/stateless.go` `Service.statelessCurrent` | body | unchanged (20) | Task 3F fix round 1 (#511 F11): its two route refusals return errStatelessRowChanged (SR-4-C58), a value that is ErrFenced to every errors.Is caller but names no fence. Same reads and comparisons; refusal text only. | |
| +| `internal/activator/swap.go` `Service.Swap` | body | unchanged (15) | Task 3F fix round 3 (#511 F11): an adopted attempt this box knows never started (errReplicaReleaseNotStartedHeld) holds the deploy as the adopted unknown phase did (SwapFailed). Error classification only; same reads. | |
| +| `internal/host/rollout.go` `armRollout` | body | unchanged (5) | Task 3F fix round 3 (#511 F11): also hands the failure book's MarkReplicaRelease and ReplicaReleaseMark to the activator, beside ReplicaDeployID. The book is the same file the agent already opened; no new read. | |
| +| `internal/rollout/failures.go` `FailureBook.saveLocked` | body | unchanged (0) | Task 3F fix round 3 (#511 F11): the saved failure file also carries the replica release marks (additive key replica_release_marks). Same write path and file. | |
| +| `internal/rollout/failures.go` `OpenFailureBook` | body | unchanged (1) | Task 3F fix round 3 (#511 F11): loads the additive replica_release_marks key from the same file it already reads. No new read. | |
| | `internal/activator/stateless.go` `Service.prepareStateless` | sites | +whole:Route ×8 | Task 3F (#511 F11): a hold's pinned wake carrying the swap's preparation, when the row it re-read differs from the prepared row, moves the preparation onto the wake's row only if the prepared row passes statelessCurrent against the registry, the two rows have the same Incarnation, ServingSeq, HoldOp and Version (sameRowLifetime, fix round 1), and the wake's row then passes statelessCurrent; otherwise it refuses with errStatelessRowChanged. The added sites are whole-Route comparisons and copies of the handed and prepared routes. No store read or write added; no new authority. | |
| -| `internal/activator/statelessrelease.go` `Service.prepareStatelessRelease` | sites | +whole:Route ×2 | Task 3F fix rounds 1-2 (#511 F11): R9 adoption moves into adoptDurable (same phases, same escrow initializer call). A begin, or the unknown close of an observed releasing attempt, that does not go through goes to refusedStep: a writer refusal (replicas.ReleaseRefused, record read by the adapter in the same call) re-runs adoptDurable once with no read of its own; anything else maps through stepError. A failed releasing write before the exec maps through stepError too. ErrReplicaReleaseUnknown stays only where a release command's result is unknown (an open release record, a successful close of this attempt, and the post-exec paths). The exec's fresh record check stays the final gate. The added sites pass the handed route to adoptDurable and refusedStep. No new store read or write. | |
| +| `internal/activator/statelessrelease.go` `Service.prepareStatelessRelease` | sites | +whole:Route ×2 | Task 3F fix rounds 1-3 (#511 F11): R9 adoption moves into adoptDurable. A begin, or the unknown close of an observed releasing attempt, that does not go through goes to refusedStep: a writer refusal (replicas.ReleaseRefused, record read by the adapter in the same call) re-runs adoptDurable once with no read of its own; anything else maps through stepError. Fix round 3: before the releasing write it saves this box's mark (MarkReplicaRelease: attempt ID and term), and after it, just before the exec, Started; a close or an in-call unknown of an attempt this box knows never started returns errReplicaReleaseNotStarted (SR-4-C59) and saves Closed. The record still closes as unknown. The marks are this box's own failure-book file (no store read or write); the exec's fresh record check stays the final gate. | |
| -Envelopes re-pinned: `internal/activator`, `internal/host`, `internal/replicas`. |
| +Envelopes re-pinned: `internal/activator`, `internal/host`, `internal/replicas`, `internal/rollout`. |
| Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| Recorded dispositions, which each change must still satisfy: |
| +- `internal/activator/activator.go` `type Service`: authority, task B,C,D,F,J4. Basis: rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b3a;basis=Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Add coordinator, existing-record observation callback and per-host preparation locks; no read in the declaration. Task 3a: Add optional canonical storage-selection and durable deploy-ID callbacks; declaration only, no read or authority in these fields.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds the heldLegs map to actEntry (legs by id, under a.mu) and heldWakeHook (atomic pointer to a callback) and heldLegSeq (atomic counter) to Service. State only, in memory; no read of tenant, app or box-agent-writable input.;rev3=census-ruling-wake-storm-cap;basis=the agent as carlos: one field, wakeSlots (chan struct{}, the wake semaphore made by New from Config.WakeSlots, default 4); declaration only, no read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Add the B2 DutyStore interface field and process-local duty view, suppression and invalidation state. No read added. B2 adds the verified-successor identity callback; no read in the declaration. B3b adds a nonblocking departure-suspicion callback, invoked only after an accepted holder-forward failure and after cache locks release; it cannot authorize a take.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: immutable callbacks installed before Start for tenant admission, local start permission, fixed route exemptions and shutdown closure; nil callbacks preserve switch-off behavior; no new reads. Fix R1: add an immutable startup-phase callback for response copy, set before service startup. No new read or execution authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Add in-memory HA loss state and pool withdrawal jobs; no new read.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 1: one new field, drain (drainSources: two atomic func pointers for this box's and peers' drain state); no read added. region HA held-requests Task 2: one new field, moves (moveTable: per-host move state, hold counts and admission tickets in memory, under mu); no read added;rev3=census-ruling-held-move-speed;basis=the agent as carlos: one new field, moveStreams (per-host in-memory set of edge.StreamEnd for requests in flight, own mutex), for the move's early stream cut; actEntry gains drainRelease (bool, under a.mu), set by DrainStop; declarations only, no read added;rev3=census-ruling-fix-silent-start-kill-861;basis=#861: two fields, wakeFailMu and wakeFailLogged (per-host in-memory note of the last journalled wake failure); declaration only, no read;rev3=census-ruling-w6-ingress-drain;basis=new field TenantStartsClosed func() bool; when it answers true tenantStartRefusal refuses every start, exempt routes included. Wired only by fixedAdmission.bind to the ingress drain's closed flag. Struct field only; no read added.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: one field, replicaPolicies (host to the newest observed replica deploy and this box label, under mu), set only by SetReplicaDeploy; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: one more in-memory field, replicaFailed (host to the permit whose successor failed here, under mu), so that step only proves what it kept; declaration only, no read. |
| - `internal/activator/stateless.go` `Service.statelessCurrent`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Recheck current registry launch inputs and fresh record lifetime against the attempt observation without a serving lease; refuse changed configuration or missing evidence. No writes; runtime caller remains to be wired. Fix 3a round 1 I2: repeated gates inspect only the current registry row and attempt-local observation. Fresh record validation moved, not removed: statelessFinalRecord at final backend exec gate. All launch-shape and lifecycle row checks retained. |
| +- `internal/activator/swap.go` `Service.Swap`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Verify the target canonical mode and prepare its durable stateless release before stopping the incumbent. A mode change forces the existing proven hold path; same-mode stateless overlap uses local lifecycle gates and the final current-record check, without a serving lease. CI fix 1: defer a missing registry row to the existing release checks only for stateful rootfs overlap, preserving disabled/newest checks and committedGood refusal. Stateless modes, transitions, binary/foreign/hold paths still fence before preparation. No new reads. Final review C1/R26: include incumbent Gen.Stateless as declaration evidence, so only matching good stateful recovery/config attempts can skip canonical lookup. Fresh route, release, ownership and stop gates unchanged.;rev3=census-ruling-stateless-failed-release-held;basis=Classify a proven stateless release failure, or the same deploy's durable failed or unknown phase, through the existing SwapFailed hold mechanism. Preparation precedes stopping the incumbent, so report overlap semantics even if the requested swap is hold. Stateful path unchanged; no new root input.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: for a set row (route FleetBoxes), refuses a stateful or non-overlap attempt before preparation, and a build the observed policy does not allow after it; refusals only, the route read is the row Swap already reads.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: a set row whose incumbent is not stateless is refused (errReplicaHold) before preparation, so the mode-change hold conversion below can never run a set row as a hold; with replicaSwapRefusal this keeps every set row off swapHold and releaseBeforeSwap. Refusal only, no read added. |
| +- `internal/host/rollout.go` `armRollout`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=fix1-merge-review;basis=Comment-only clarification of failure-book saves; existing agent rollout setup remains legacy.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: after the overlap scheduler arms, calls svc.ArmRootfs() so rootfs rows start only where the scheduler armed this boot; never on the refuseManaged path; no read added;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Bind Service.ReplicaDeployID to the same FailureBook the scheduler owns and bind RuntimeSelection to one CanonicalStatelessDigest read through the existing store. Fix 3a round 1 R18: canonical selection receives route stateless projection to keep legacy DemandHold fallback only for stateful/unknown builds; staged digest mismatch still refuses.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: the scheduler box label is rolloutBox(svc): the fleet identity label already on svc.Fleet (set from identity.Label before the scheduler arms), else BoxLabel() as before. No read added. |
| +- `internal/rollout/failures.go` `FailureBook.saveLocked`: authority, task E3. Basis: rev3=PROPOSED-p3;run=8;identity=root adoption uid 0 or legacy rollout uid carlos;basis=root instance uses checked store writer; legacy instances retain the original atomic file writer and epoch semantics;rev3=census-ruling-stateless-replicas-1;basis=Persist the additive replica_releases selection carrier in the existing failure-book atomic write; no new path, record writer or authority. IDs are returned only after a successful save. |
| +- `internal/rollout/failures.go` `OpenFailureBook`: authority, task E1,E3,J1,J4. Basis: fix1-merge-review;basis=Loads schema-three durable generations and refuses unsafe identity recovery on entropy failure.;rev3=census-ruling-stateless-replicas-1;basis=Load the additive replica_releases carrier from the same existing failure-book ReadFile; unchanged schema acceptance, identity recovery, reconciliation and read site. No additional read. |
| - `internal/activator/stateless.go` `Service.prepareStateless`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Capture RecordFacts from the existing record source, obtain the durable FailureBook deploy ID, and call Task 2 PrepareStatelessRelease with the canonical verdict/digest carrier. Carry a successful attempt through its hold only after another current-record check; no serving lease or polling loop. Fix 3a round 1 I2: preparation uses reconcile observations and records the successful deploy ID. Carry prepared evidence through hold; fresh backend read must confirm that same released deploy before web runs.;rev3=census-ruling-stateless-failed-release-held;basis=For recovery onto a different installed version's exact committed good version and artifact digest, retain recovery evidence without selecting or writing another deploy. Adds the existing committedGood registry read, with its route and incarnation check. Canonical storage declaration and observed lifetime gates remain.;rev3=census-ruling-stateless-replicas-4-task1;basis=R1: no longer calls ReplicaDeployID before preparation; hands the same a.ReplicaDeployID selector to prepareStatelessRelease, which calls it only after coordinator term acquisition. The ObservedReplicaRelease call stays as a validity check. Same read sites; no new read, write or authority.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2 (D4): for a set row, prepares the record baseline with no release, and refuses a build the row Version does not name before any release; reads the route it is handed (FleetBoxes, Version). No store read or write added.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: for a set row, a build its pointer does not name starts only as the record baseline or the committed permitted target, the latter adopted through prepareStatelessRelease durable path (never a new attempt); a named build, a rollback included, takes the release path. The added reads are the handed route (FleetBoxes, Version) and a copy of it with Stateless set for the adoption, as the release path already builds. No store read or write added.;rev3=census-ruling-stateless-replicas-4-task2-fix2;basis=Task 2 fix round 2: for a set row the no-release start is decided per box from the record (this box baseline, or its permitted target adopted through the durable path), whatever the pointer says; only a build that is neither and that the pointer names begins a new attempt. Same reads (the handed route and its copy); no store read or write added.;rev3=census-ruling-stateless-replicas-4-task2-fix3;basis=Task 2 fix round 3: this box baseline is checked before the adopt path, so a completed box restarts on the target while a retry is requested; for the passed target it calls the existing escrow initializer (prepareStatelessEscrow) that the adopt path ran, with the same route and identity. No new reader; no record write. |
| - `internal/activator/statelessrelease.go` `Service.prepareStatelessRelease`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-stateless-replicas-4-task1;basis=The former PrepareStatelessRelease body. R9: adopts the record's attempt for this lifetime and target in every phase before any coordination; otherwise acquires the term first and only then selects the ID (R1); a begin carries RetryOf only when consuming a durable retry. Same calls (ObserveReplicaRelease, coordinator, escrow initializer, actEntry, runReleaseAdmitted); same gates, proof and SafeUntil checks; no new store read or writer.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: refuses with provision.ErrReplicaSwitchOpen (SR-4-C31) before term acquisition when the observed record already has an unresolved copy-switch permit, instead of a begin the writer refuses and that read as an unknown result. Refusal only; same calls, no read added. |
| @@ -24,6 +34,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the |
| - new `internal/activator/statelessrelease.go:Service.adoptDurable`: reads +whole:Route; written legacy, accepted-legacy, frozen |
| - new `internal/activator/statelessrelease.go:Service.refusedStep`: reads +whole:Route; written legacy, accepted-legacy, frozen |
| -Seal: `bd25367161555e8a9c5b0df079ad2d8eb648ebaeae3f407e6c638f2f7f01605b` → `8c7ae110ab94e18c6689533cc7fd43eec337fd78adb88c4f203ec24fda740d85`. |
| +Seal: `bd25367161555e8a9c5b0df079ad2d8eb648ebaeae3f407e6c638f2f7f01605b` → `45b27ac0e2f2152497e3c01f277c2230defaeb3be363170ea61b05d72f0a6782`. |
| Overlay: `internal/provision/testdata/plan14-root-reads-stateless-replicas-4-task3f.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md b/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md| index ea95c6fd7..518763a84 100644 |
| --- a/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md |
| +++ b/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md |
| @@ -130,3 +130,5 @@ copy too. Internal wire enums are not an excuse to expose unreviewed text. |
| | SR-4-C56 | internal/activator/statelessrelease.go | this box is no longer coordinating this deploy, so nothing started | pending (added by Plan 4 Task 3F fix round 1: a release step this box did not send because it no longer held the coordinator term, or was shutting down; awaiting Paul's copy review) | |
| | SR-4-C57 | internal/activator/statelessrelease.go | the deploy record did not confirm this release step, so nothing started. the next start tries again | pending (added by Plan 4 Task 3F fix round 1: a release step whose answer was lost or did not match, which used to read as an unknown command result; fix round 2 also uses it for a close of a stale releasing observation whose outcome is not established; awaiting Paul's copy review) | |
| | SR-4-C58 | internal/activator/stateless.go | the instance's route row no longer matches the one this start was prepared against, so nothing started | pending (added by Plan 4 Task 3F fix round 1: a stateless start whose route row changed after its preparation, which used to read as "maintenance fence active"; fix round 2 narrowed it from "settings changed" to what is known; awaiting Paul's copy review) | |
| +| SR-4-C59 | internal/activator/statelessrelease.go | the release command did not start, and its attempt is closed. deploy again to retry it | pending (added by Plan 4 Task 3F fix round 3: an attempt this box moved to releasing and knows it never started, closed as unknown on the record; it used to read as an unknown result; awaiting Paul's copy review) | |
| +| SR-4-C60 | internal/activator/statelessrelease.go | this box could not save its release step, so nothing started | pending (added by Plan 4 Task 3F fix round 3: the box's own evidence of a release step could not be saved, so the step was not taken; awaiting Paul's copy review) | |
diff --git a/internal/activator/activator.go b/internal/activator/activator.go| index cfa676ae1..04612ad58 100644 |
| --- a/internal/activator/activator.go |
| +++ b/internal/activator/activator.go |
| @@ -1292,9 +1292,15 @@ type Service struct { |
| // Set these before use. ObserveReplicaRelease reuses the wake/rollout |
| // record observation and supplies the canonical manifest digest, not |
| // the staged artifact digest. Missing observations refuse execution. |
| - Coordinator CoordinatorClient |
| - StorageDeclaration func(context.Context, registry.Route, release.StagedIdentity) (bool, string, error) |
| - ReplicaDeployID func(replicas.Identity, replicas.Build, *replicas.Deploy) (string, error) |
| + Coordinator CoordinatorClient |
| + StorageDeclaration func(context.Context, registry.Route, release.StagedIdentity) (bool, string, error) |
| + ReplicaDeployID func(replicas.Identity, replicas.Build, *replicas.Deploy) (string, error) |
| + // MarkReplicaRelease and ReplicaReleaseMark keep this box's evidence of |
| + // the release attempt it moved to releasing (the failure book's |
| + // replicas.ReleaseMark, #511 F11): whether the command started here. |
| + // Without them the box cannot tell, and an unknown result says so. |
| + MarkReplicaRelease func(replicas.Identity, replicas.ReleaseMark) error |
| + ReplicaReleaseMark func(replicas.Identity) (replicas.ReleaseMark, bool) |
| ObserveReplicaRelease func(context.Context, registry.Route) (replicas.Identity, replicas.Build, *replicas.Deploy, error) |
| replicaReleaseLocks sync.Map |
| // replicaPolicies is each set row's newest observed deploy |
diff --git a/internal/activator/stateless_holdwake_test.go b/internal/activator/stateless_holdwake_test.go| index af6875be1..815cdcda2 100644 |
| --- a/internal/activator/stateless_holdwake_test.go |
| +++ b/internal/activator/stateless_holdwake_test.go |
| @@ -4,6 +4,7 @@ import ( |
| "context" |
| "errors" |
| "strings" |
| + "sync" |
| "testing" |
| "time" |
| @@ -293,3 +294,108 @@ func TestReplicaReleaseStepFailuresSayWhatIsKnown(t *testing.T) { |
| }) |
| } |
| } |
| + |
| +// lostReleasingReply is replicaReleaseStore whose releasing write commits |
| +// and whose reply is then lost, once. |
| +type lostReleasingReply struct { |
| + *replicaReleaseStore |
| + lost *bool |
| +} |
| + |
| +func (l lostReleasingReply) ReleaseState(ctx context.Context, id replicas.Identity, c replicas.ReleaseChange) (replicas.Deploy, error) { |
| + d, err := l.replicaReleaseStore.ReleaseState(ctx, id, c) |
| + if err == nil && c.Op == "releasing" && !*l.lost { |
| + *l.lost = true |
| + return replicas.Deploy{}, context.DeadlineExceeded |
| + } |
| + return d, err |
| +} |
| + |
| +// memoryMarks is the failure book's release marks, in memory. |
| +func memoryMarks(a *Service) { |
| + var mu sync.Mutex |
| + marks := map[replicas.Identity]replicas.ReleaseMark{} |
| + a.MarkReplicaRelease = func(id replicas.Identity, m replicas.ReleaseMark) error { |
| + mu.Lock() |
| + defer mu.Unlock() |
| + marks[id] = m |
| + return nil |
| + } |
| + a.ReplicaReleaseMark = func(id replicas.Identity) (replicas.ReleaseMark, bool) { |
| + mu.Lock() |
| + defer mu.Unlock() |
| + m, ok := marks[id] |
| + return m, ok |
| + } |
| +} |
| + |
| +// TestReplicaReleaseNotStartedSaysSo is #511 F11 fix round 3, the |
| +// reviewer's sequence: the releasing write commits, its reply is lost, the |
| +// exec is refused, and the next wake closes the attempt. This box knows the |
| +// command never started, so neither that close nor a later adoption of the |
| +// closed attempt says the result is unknown, and neither grows a |
| +// resident's backoff. The record still closes as unknown. When the command |
| +// did start, the result stays unknown. |
| +func TestReplicaReleaseNotStartedSaysSo(t *testing.T) { |
| + rt := testRoute("shop.example.com") |
| + rt.Hibernate, rt.Runtime = false, registry.RuntimeRootfsV1 |
| + now := time.Unix(1000, 0) |
| + failures := func(err error) int { |
| + a := &Service{now: func() time.Time { return now }} |
| + e := &actEntry{host: rt.Host, route: rt} |
| + a.mu.Lock() |
| + defer a.mu.Unlock() |
| + for i := 0; i < 3; i++ { |
| + a.noteResidentWakeLocked(e, err) |
| + } |
| + return a.residents[rt.Host].failures |
| + } |
| + t.Run("releasing reply lost, never started", func(t *testing.T) { |
| + r, s := replicaReleaseRig(t) |
| + memoryMarks(r.a) |
| + lost := false |
| + r.a.Coordinator = lostReleasingReply{s, &lost} |
| + if err := r.a.PrepareStatelessRelease(context.Background(), r.rt, r.id, "deploy"); !errors.Is(err, errReplicaStepUnconfirmed) { |
| + t.Fatalf("lost releasing reply: %v", err) |
| + } |
| + if r.b.startCount() != 0 || s.snapshot().Phase != "releasing" { |
| + t.Fatalf("starts=%d record=%+v", r.b.startCount(), s.snapshot()) |
| + } |
| + // The next wake closes the attempt, then a later one adopts it. |
| + for _, want := range []error{errReplicaReleaseNotStarted, errReplicaReleaseNotStartedHeld} { |
| + err := r.a.PrepareStatelessRelease(context.Background(), r.rt, r.id, "deploy") |
| + if !errors.Is(err, want) || errors.Is(err, ErrReplicaReleaseUnknown) { |
| + t.Fatalf("got %v, want %v", err, want) |
| + } |
| + if strings.Contains(err.Error(), "unknown") || !strings.Contains(err.Error(), "did not start") { |
| + t.Fatalf("wording: %q", err) |
| + } |
| + if got := failures(err); got != 0 { |
| + t.Fatalf("%v: resident failures %d", err, got) |
| + } |
| + if r.b.startCount() != 0 || s.snapshot().Phase != "unknown" { |
| + t.Fatalf("starts=%d record=%+v", r.b.startCount(), s.snapshot()) |
| + } |
| + } |
| + }) |
| + t.Run("command started", func(t *testing.T) { |
| + r, s := replicaReleaseRig(t) |
| + memoryMarks(r.a) |
| + done := prepareReplica(r, "deploy") |
| + r.waitStarted(t) |
| + s.held.lose(replicas.ErrFenced) |
| + if err := replicaResult(t, done); !errors.Is(err, ErrReplicaReleaseUnknown) { |
| + t.Fatalf("lost lease after start: %v", err) |
| + } |
| + s.held = newOwnedLease(time.Now().Add(time.Hour), false) |
| + for i := 0; i < 2; i++ { |
| + err := r.a.PrepareStatelessRelease(context.Background(), r.rt, r.id, "deploy") |
| + if !errors.Is(err, ErrReplicaReleaseUnknown) || errors.Is(err, errReplicaReleaseNotStarted) { |
| + t.Fatalf("started command, wake %d: %v", i, err) |
| + } |
| + } |
| + if r.b.startCount() != 1 || s.snapshot().Phase != "unknown" { |
| + t.Fatalf("starts=%d record=%+v", r.b.startCount(), s.snapshot()) |
| + } |
| + }) |
| +} |
diff --git a/internal/activator/statelessrelease.go b/internal/activator/statelessrelease.go| index a82d04863..083093313 100644 |
| --- a/internal/activator/statelessrelease.go |
| +++ b/internal/activator/statelessrelease.go |
| @@ -30,8 +30,50 @@ var ( |
| // match (a lost reply); the begin may have been recorded, and an |
| // identical begin replays it. copy SR-4-C57 (provisional) |
| errReplicaStepUnconfirmed = errors.New("the deploy record did not confirm this release step, so nothing started. the next start tries again") |
| + // errReplicaMarkUnsaved: this box could not save its own evidence of |
| + // the attempt before the step, so it took no step. copy SR-4-C60 |
| + // (provisional) |
| + errReplicaMarkUnsaved = errors.New("this box could not save its release step, so nothing started") |
| + // errReplicaReleaseNotStarted: an attempt this box moved to releasing, |
| + // whose command it knows it never started, is closed as unknown on the |
| + // record (retry semantics unchanged). copy SR-4-C59 (provisional) |
| + errReplicaReleaseNotStarted = errors.New("the release command did not start, and its attempt is closed. deploy again to retry it") |
| ) |
| +// errReplicaReleaseNotStartedHeld is errReplicaReleaseNotStarted adopted |
| +// from the record, as errReplicaReleaseUnknown is the unknown phase's: the |
| +// deploy holds until a deploy retries it. |
| +var errReplicaReleaseNotStartedHeld = fmt.Errorf("release: %w", errReplicaReleaseNotStarted) |
| + |
| +// knownNotStarted reports whether this box's own mark shows that it moved |
| +// attempt d to releasing and never reached the command's exec. term is the |
| +// term the releasing phase was written under; an empty term asks instead |
| +// whether this box already closed d knowing that (Closed). No mark, another |
| +// attempt or another term is no evidence: the box cannot tell. |
| +func (a *Service) knownNotStarted(identity replicas.Identity, d *replicas.Deploy, term string) bool { |
| + if a.ReplicaReleaseMark == nil || d == nil { |
| + return false |
| + } |
| + m, ok := a.ReplicaReleaseMark(identity) |
| + if !ok || m.ID != d.ID || m.Started { |
| + return false |
| + } |
| + if term == "" { |
| + return m.Closed |
| + } |
| + return m.Term == term |
| +} |
| + |
| +// noteClosedNotStarted records that this box closed attempt id, which it |
| +// knows never started here, so a later adoption of its unknown phase says |
| +// so. A failed save only loses that evidence; the later message is then |
| +// the unknown one, which is still true. |
| +func (a *Service) noteClosedNotStarted(identity replicas.Identity, id, term string) { |
| + if a.MarkReplicaRelease != nil { |
| + _ = a.MarkReplicaRelease(identity, replicas.ReleaseMark{ID: id, Term: term, Closed: true}) |
| + } |
| +} |
| + |
| // adoptDurable is R9's adoption of the record's attempt d for this lifetime |
| // and target: a passed release (with its escrow recovery), a failed one or |
| // an unknown one. ok is false when d holds no such attempt in one of those |
| @@ -48,6 +90,9 @@ func (a *Service) adoptDurable(ctx context.Context, rt registry.Route, identity |
| } |
| return durable.ID, nil, true |
| case durable.Phase == "unknown": |
| + if a.knownNotStarted(identity, durable, "") { |
| + return durable.ID, errReplicaReleaseNotStartedHeld, true |
| + } |
| return durable.ID, errReplicaReleaseUnknown, true |
| case durable.Phase == "failed": |
| return durable.ID, errReplicaReleaseFailed, true |
| @@ -201,6 +246,12 @@ func (a *Service) prepareStatelessRelease(ctx context.Context, rt registry.Route |
| } |
| if old.ID == deployID { |
| // The record now durably holds this attempt's result as unknown. |
| + // When this box wrote that releasing phase and never reached the |
| + // exec, it knows the command did not start (#511 F11). |
| + if a.knownNotStarted(identity, old, old.Term) { |
| + a.noteClosedNotStarted(identity, old.ID, old.Term) |
| + return deployID, errReplicaReleaseNotStarted |
| + } |
| return deployID, ErrReplicaReleaseUnknown |
| } |
| revision = closed.Revision |
| @@ -242,6 +293,9 @@ func (a *Service) prepareStatelessRelease(ctx context.Context, rt registry.Route |
| return nil |
| } |
| releasing := false |
| + // notStarted: this box wrote releasing and knows it has not reached the |
| + // exec; it holds only with marks on (#511 F11). |
| + notStarted := false |
| run := func() (bool, error) { |
| if !rt.Rootfs() { |
| if err := release.VerifyStaged(id); err != nil { |
| @@ -250,11 +304,27 @@ func (a *Service) prepareStatelessRelease(ctx context.Context, rt registry.Route |
| return false, gate() |
| } |
| return a.runReleaseAdmitted(ctx, e, rt, id, watchOf(held), gate, func() error { |
| + // The mark goes first, so a releasing write whose reply is lost |
| + // is one this box can later say it never ran. |
| + if a.MarkReplicaRelease != nil { |
| + if err := a.MarkReplicaRelease(identity, replicas.ReleaseMark{ID: deployID, Term: term}); err != nil { |
| + return errReplicaMarkUnsaved |
| + } |
| + } |
| if _, err := change("releasing"); err != nil { |
| // Before the command's exec: nothing ran (#511 F11). |
| return stepError(err) |
| } |
| releasing = true |
| + if a.MarkReplicaRelease != nil { |
| + notStarted = true |
| + // Started is written just before the exec. What fails after |
| + // it, before the exec, reads as unknown: the safe side. |
| + if err := a.MarkReplicaRelease(identity, replicas.ReleaseMark{ID: deployID, Term: term, Started: true}); err != nil { |
| + return errReplicaMarkUnsaved |
| + } |
| + notStarted = false |
| + } |
| return nil |
| }) |
| } |
| @@ -270,6 +340,10 @@ func (a *Service) prepareStatelessRelease(ctx context.Context, rt registry.Route |
| } |
| } |
| if valid() != nil { |
| + if notStarted { |
| + // The record still says releasing; the next wake closes it. |
| + return deployID, errReplicaTermLost |
| + } |
| return deployID, ErrReplicaReleaseUnknown |
| } |
| _, err = change(phase) |
| @@ -281,9 +355,16 @@ func (a *Service) prepareStatelessRelease(ctx context.Context, rt registry.Route |
| return deployID, nil |
| } |
| } |
| + if notStarted { |
| + return deployID, stepError(err) |
| + } |
| return deployID, ErrReplicaReleaseUnknown |
| } |
| if phase == "unknown" { |
| + if notStarted { |
| + a.noteClosedNotStarted(identity, deployID, term) |
| + return deployID, errReplicaReleaseNotStarted |
| + } |
| return deployID, ErrReplicaReleaseUnknown |
| } |
| return deployID, runErr |
diff --git a/internal/activator/swap.go b/internal/activator/swap.go| index 92be24158..3f6bd968b 100644 |
| --- a/internal/activator/swap.go |
| +++ b/internal/activator/swap.go |
| @@ -251,9 +251,11 @@ const ( |
| // surfaces from inside the spawn is abandonment, never the build's failure. |
| // |
| // A stateless release step that did not go through (#511 F11: |
| -// errReplicaRecordRefused, errReplicaTermLost, errReplicaStepUnconfirmed) |
| -// is NoOwnership too: no release command ran and no attempt began, so it |
| -// is never the build's failure, and a resident's backoff does not grow. |
| +// errReplicaRecordRefused, errReplicaTermLost, errReplicaStepUnconfirmed, |
| +// errReplicaMarkUnsaved, and errReplicaReleaseNotStarted for an attempt this |
| +// box knows never started here) is NoOwnership too: no release command ran, |
| +// so it is never the build's failure, and a resident's backoff does not |
| +// grow. |
| // |
| // errSwapStopped (the barrier's cancel, from memberCurrentLocked) is |
| // NoOwnership too: the entry is stopping, so nothing may spawn for it. |
| @@ -281,7 +283,8 @@ func verdictOf(err error) gateVerdict { |
| errors.Is(err, errRootfsBinaryLaunch), errors.Is(err, errNoRootfsControl), |
| errors.Is(err, errBuildStateUnwritten), errors.Is(err, errOwnershipRefused), |
| errors.Is(err, errReleaseOpen), errors.Is(err, errReleaseNotPassed), errors.Is(err, errReleaseTurnedOff), |
| - errors.Is(err, errReplicaRecordRefused), errors.Is(err, errReplicaTermLost), errors.Is(err, errReplicaStepUnconfirmed): |
| + errors.Is(err, errReplicaRecordRefused), errors.Is(err, errReplicaTermLost), errors.Is(err, errReplicaStepUnconfirmed), |
| + errors.Is(err, errReplicaMarkUnsaved), errors.Is(err, errReplicaReleaseNotStarted): |
| return gateNoOwnership |
| } |
| return gateProceed |
| @@ -404,7 +407,7 @@ func (a *Service) Swap(ctx context.Context, at Attempt, newest func(host string) |
| prepared, err := a.prepareStateless(ctx, route, id, digest) |
| if err != nil { |
| res := releaseSwapResult(err, false, a.releaseOpen(at.Host)) |
| - if errors.Is(err, errReplicaReleaseFailed) || errors.Is(err, errReplicaReleaseUnknown) { |
| + if errors.Is(err, errReplicaReleaseFailed) || errors.Is(err, errReplicaReleaseUnknown) || errors.Is(err, errReplicaReleaseNotStartedHeld) { |
| res = SwapResult{Outcome: SwapFailed, Reason: err.Error()} |
| } |
| if res.Outcome == SwapFailed { |
diff --git a/internal/host/rollout.go b/internal/host/rollout.go| index b5a8a2d11..25f246ea9 100644 |
| --- a/internal/host/rollout.go |
| +++ b/internal/host/rollout.go |
| @@ -386,6 +386,7 @@ func armRollout(ctx context.Context, getenv func(string) string, svc *activator. |
| return nil |
| } |
| svc.ReplicaDeployID = book.ReplicaDeployID |
| + svc.MarkReplicaRelease, svc.ReplicaReleaseMark = book.MarkReplicaRelease, book.ReplicaReleaseMark |
| m := rollout.NewManager(ctx, rollout.Deps{ |
| Act: svc, Routes: reg, Book: book, OptDir: release.OptDir(), DataDir: dd, Box: rolloutBox(svc), |
| Demand: func(ctx context.Context, acct, app, ver, path string) (string, string, error) { |
diff --git a/internal/host/rolloutdeclined.go b/internal/host/rolloutdeclined.go| index b71c01bbf..68b74728e 100644 |
| --- a/internal/host/rolloutdeclined.go |
| +++ b/internal/host/rolloutdeclined.go |
| @@ -87,6 +87,7 @@ func honourDeclinedFailures(svc *activator.Service, reg *registry.Registry, dd, |
| return |
| } |
| svc.ReplicaDeployID = book.ReplicaDeployID |
| + svc.MarkReplicaRelease, svc.ReplicaReleaseMark = book.MarkReplicaRelease, book.ReplicaReleaseMark |
| if n := book.Reconciled(); n > 0 { |
| // An armed run's executions left unrecorded (Task 5): their records |
| // are honoured below whether or not the save below lands, since the |
diff --git a/internal/host/stagerelay.go b/internal/host/stagerelay.go| index 991676b38..dd37bb6b9 100644 |
| --- a/internal/host/stagerelay.go |
| +++ b/internal/host/stagerelay.go |
| @@ -220,6 +220,7 @@ func armRolloutAndRelay(ctx context.Context, getenv func(string) string, svc *ac |
| if svc != nil && svc.ReplicaDeployID == nil && !rollout.Enabled(getenv) { |
| if book, err := rollout.OpenFailureBook(dd); err == nil { |
| svc.ReplicaDeployID = book.ReplicaDeployID |
| + svc.MarkReplicaRelease, svc.ReplicaReleaseMark = book.MarkReplicaRelease, book.ReplicaReleaseMark |
| } |
| } |
| if m != nil { |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index 9f259b0bf..4e454f351 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -177,4 +177,4 @@ plan14-root-reads-stateless-replicas-4-task2-fix1.tsv 1a0605f79ac62c776bccc1ae8d |
| plan14-root-reads-stateless-replicas-4-task2-fix2.tsv 5f83de2e018b47543789a8dbe2cccb86b2d644fbe9ee5771e5d621704ae46e0b |
| plan14-root-reads-stateless-replicas-4-task2-fix3.tsv bd25367161555e8a9c5b0df079ad2d8eb648ebaeae3f407e6c638f2f7f01605b |
| plan14-root-reads-stateless-replicas-4-task3.tsv bd25367161555e8a9c5b0df079ad2d8eb648ebaeae3f407e6c638f2f7f01605b |
| -plan14-root-reads-stateless-replicas-4-task3f.tsv 8c7ae110ab94e18c6689533cc7fd43eec337fd78adb88c4f203ec24fda740d85 |
| +plan14-root-reads-stateless-replicas-4-task3f.tsv 45b27ac0e2f2152497e3c01f277c2230defaeb3be363170ea61b05d72f0a6782 |
diff --git a/internal/provision/testdata/plan14-root-reads-stateless-replicas-4-task3f.tsv b/internal/provision/testdata/plan14-root-reads-stateless-replicas-4-task3f.tsv| index e48b2e537..ce13673f5 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-stateless-replicas-4-task3f.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-stateless-replicas-4-task3f.tsv |
| @@ -1,18 +1,26 @@ |
| # Census overlay stateless-replicas-4-task3f, written by census-propose (#369). census-ruling-stateless-replicas-4-task3f, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-stateless-replicas-4-task3f.md. |
| -# 1 body, 2 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 6 body, 2 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| # 3 new dispositions: 0 reads re-frozen at their disposition with the claim, 3 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other. |
| @legacy 887db36e2cd53538e437a0ce0c2e466e7143332f7014b031749ce984d892f7f2 internal/activator/stateless.go Service.statelessCurrent legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Recheck current registry launch inputs and fresh record lifetime against the attempt observation without a serving lease; refuse changed configuration or missing evidence. No writes; runtime caller remains to be wired. Fix 3a round 1 I2: repeated gates inspect only the current registry row and attempt-local observation. Fresh record validation moved, not removed: statelessFinalRecord at final backend exec gate. All launch-shape and lifecycle row checks retained.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 1 (#511 F11): its two route refusals return errStatelessRowChanged (SR-4-C58), a value that is ErrFenced to every errors.Is caller but names no fence. Same reads and comparisons; refusal text only. registry:Args@467,registry:Args@478,registry:Caps@444,registry:Caps@455,registry:Channel@378,registry:Channel@392,registry:CreatedAt@490,registry:CreatedAt@506,registry:Environment@407,registry:Environment@425,registry:Host@204,registry:Stateless@523,registry:Stateless@539,whole:Route@275,whole:Route@279,whole:Route@348,whole:Route@370,whole:Route@667,whole:Route@679,whole:Route@763 bb80cfe535efc3a5b30d4a81ab759242e46dc6fd7bc41de9638e8c01f74cc4dc |
| +@legacy 8e7099c548f5e6632686b9a66f05a903922e189030a3e96d4c6195fb03bdcaa4 internal/activator/swap.go Service.Swap legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Verify the target canonical mode and prepare its durable stateless release before stopping the incumbent. A mode change forces the existing proven hold path; same-mode stateless overlap uses local lifecycle gates and the final current-record check, without a serving lease. CI fix 1: defer a missing registry row to the existing release checks only for stateful rootfs overlap, preserving disabled/newest checks and committedGood refusal. Stateless modes, transitions, binary/foreign/hold paths still fence before preparation. No new reads. Final review C1/R26: include incumbent Gen.Stateless as declaration evidence, so only matching good stateful recovery/config attempts can skip canonical lookup. Fresh route, release, ownership and stop gates unchanged.;rev3=census-ruling-stateless-failed-release-held;basis=Classify a proven stateless release failure, or the same deploy's durable failed or unknown phase, through the existing SwapFailed hold mechanism. Preparation precedes stopping the incumbent, so report overlap semantics even if the requested swap is hold. Stateful path unchanged; no new root input.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: for a set row (route FleetBoxes), refuses a stateful or non-overlap attempt before preparation, and a build the observed policy does not allow after it; refusals only, the route read is the row Swap already reads.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: a set row whose incumbent is not stateless is refused (errReplicaHold) before preparation, so the mode-change hold conversion below can never run a set row as a hold; with replicaSwapRefusal this keeps every set row off swapHold and releaseBeforeSwap. Refusal only, no read added.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): an adopted attempt this box knows never started (errReplicaReleaseNotStartedHeld) holds the deploy as the adopted unknown phase did (SwapFailed). Error classification only; same reads. registry:FleetBoxes@1723,registry:Stateless@1340,registry:Stateless@1369,whole:Route@1013,whole:Route@1063,whole:Route@1072,whole:Route@1257,whole:Route@1333,whole:Route@1446,whole:Route@1690,whole:Route@2254,whole:Route@2777,whole:Route@3195,whole:Route@785,whole:Route@801 0e88a84a74bc36696eeae06ab7237aca3281345c0a6a416dec7a7bc7f35d1118 |
| +@legacy f1c5ee9a9f8a9686f757962b5bbd6c10d447544405a0afe739233b1511e2bdff internal/host/rollout.go armRollout legacy accepted-legacy accepted-legacy;rev3=fix1-merge-review;basis=Comment-only clarification of failure-book saves; existing agent rollout setup remains legacy.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: after the overlap scheduler arms, calls svc.ArmRootfs() so rootfs rows start only where the scheduler armed this boot; never on the refuseManaged path; no read added;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Bind Service.ReplicaDeployID to the same FailureBook the scheduler owns and bind RuntimeSelection to one CanonicalStatelessDigest read through the existing store. Fix 3a round 1 R18: canonical selection receives route stateless projection to keep legacy DemandHold fallback only for stateful/unknown builds; staged digest mismatch still refuses.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: the scheduler box label is rolloutBox(svc): the fleet identity label already on svc.Fleet (set from identity.Label before the scheduler arms), else BoxLabel() as before. No read added.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): also hands the failure book's MarkReplicaRelease and ReplicaReleaseMark to the activator, beside ReplicaDeployID. The book is the same file the agent already opened; no new read. registry:App@3016,registry:Stateless@3035,whole:Route@3011,whole:Route@3703,whole:Route@3787 e2f344b05be5995514f4c1a6f84a45c6b1508bf70c23fef9f0425e612fa8e1a2 |
| @legacy f6033b40e9a95ab1f0791170ec35188eaac78219f2b7552408dc9766ce27e639 internal/activator/stateless.go sameRowLifetime legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 1 (#511 F11): new. Compares four fields (Incarnation, ServingSeq, HoldOp, Version) of two in-memory route rows it is handed; no read, write or authority. registry:HoldOp@153,registry:HoldOp@172,registry:Incarnation@67,registry:Incarnation@91,registry:ServingSeq@111,registry:ServingSeq@134,registry:Version@187,registry:Version@207 8cc7ffa914050e09404a4e4a13657db356014ff97cca8cc641dafdaa16a1d6cc |
| -@legacy 16c7f9c2393d58e24e579c3a2a16e3c676aae502bab5edd51c8b178238563b93 internal/activator/statelessrelease.go Service.adoptDurable legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 1 (#511 F11): new; the R9 adoption switch moved out of prepareStatelessRelease unchanged: DurableAttempt on the attempt it is handed, then the same escrow initializer call (prepareStatelessEscrow) for a passed release, or the failed or unknown sentinel. No new read, write or authority. whole:Route@459 4c32b8d100a319d2a099db1faa9f36b40fedf095583a6ff30ec5ad1345cc41c8 |
| +@legacy c5abb36a2da93bc2e5564c83e17dd492671cbcc2b3905fcdd3f37048731d7e88 internal/activator/statelessrelease.go Service.adoptDurable legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix rounds 1 and 3 (#511 F11): new; the R9 adoption switch moved out of prepareStatelessRelease: DurableAttempt on the attempt it is handed, then the same escrow initializer call for a passed release, or the failed or unknown sentinel. Fix round 3: an unknown phase of an attempt this box closed knowing it never started (its own mark) reads as errReplicaReleaseNotStartedHeld. No store read, write or authority. whole:Route@459 b47c243ad268145b8c29f561251c6cb6a5b83b0e28abf6270395a9c440945cb5 |
| @legacy 33bfff5249a4d7e23b11f582e0068c7da08ed5fda64149f080b16b21783c04dd internal/activator/statelessrelease.go Service.refusedStep legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix rounds 1-2 (#511 F11): new. For a writer refusal (replicas.ReleaseRefused) it calls adoptDurable once on the record attempt the refusal carries; otherwise, or when nothing adopts, it returns stepError's ran-nothing sentinel (an unreachable console keeps its own error). It reads only the handed route and error; no store read, write or authority. whole:Route@277 78b6a7ec4509bcccbd6640f4cf657994749b19e01f0116e0d8398668ecc610de |
| @legacy 23ffec670212b09610996854bd32476cef1a8e192b3824a12a79ee946735707d internal/activator/stateless.go Service.prepareStateless legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Capture RecordFacts from the existing record source, obtain the durable FailureBook deploy ID, and call Task 2 PrepareStatelessRelease with the canonical verdict/digest carrier. Carry a successful attempt through its hold only after another current-record check; no serving lease or polling loop. Fix 3a round 1 I2: preparation uses reconcile observations and records the successful deploy ID. Carry prepared evidence through hold; fresh backend read must confirm that same released deploy before web runs.;rev3=census-ruling-stateless-failed-release-held;basis=For recovery onto a different installed version's exact committed good version and artifact digest, retain recovery evidence without selecting or writing another deploy. Adds the existing committedGood registry read, with its route and incarnation check. Canonical storage declaration and observed lifetime gates remain.;rev3=census-ruling-stateless-replicas-4-task1;basis=R1: no longer calls ReplicaDeployID before preparation; hands the same a.ReplicaDeployID selector to prepareStatelessRelease, which calls it only after coordinator term acquisition. The ObservedReplicaRelease call stays as a validity check. Same read sites; no new read, write or authority.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2 (D4): for a set row, prepares the record baseline with no release, and refuses a build the row Version does not name before any release; reads the route it is handed (FleetBoxes, Version). No store read or write added.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: for a set row, a build its pointer does not name starts only as the record baseline or the committed permitted target, the latter adopted through prepareStatelessRelease durable path (never a new attempt); a named build, a rollback included, takes the release path. The added reads are the handed route (FleetBoxes, Version) and a copy of it with Stateless set for the adoption, as the release path already builds. No store read or write added.;rev3=census-ruling-stateless-replicas-4-task2-fix2;basis=Task 2 fix round 2: for a set row the no-release start is decided per box from the record (this box baseline, or its permitted target adopted through the durable path), whatever the pointer says; only a build that is neither and that the pointer names begins a new attempt. Same reads (the handed route and its copy); no store read or write added.;rev3=census-ruling-stateless-replicas-4-task2-fix3;basis=Task 2 fix round 3: this box baseline is checked before the adopt path, so a completed box restarts on the target while a retry is requested; for the passed target it calls the existing escrow initializer (prepareStatelessEscrow) that the adopt path ran, with the same route and identity. No new reader; no record write.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F (#511 F11): a hold's pinned wake carrying the swap's preparation, when the row it re-read differs from the prepared row, moves the preparation onto the wake's row only if the prepared row passes statelessCurrent against the registry, the two rows have the same Incarnation, ServingSeq, HoldOp and Version (sameRowLifetime, fix round 1), and the wake's row then passes statelessCurrent; otherwise it refuses with errStatelessRowChanged. The added sites are whole-Route comparisons and copies of the handed and prepared routes. No store read or write added; no new authority. registry:Account@284,registry:Account@310,registry:App@324,registry:App@346,registry:Digest@4780,registry:FleetBoxes@1967,registry:FleetBoxes@4423,registry:Host@250,registry:Host@273,registry:Stateless@3505,registry:Stateless@4030,registry:Stateless@5078,registry:Version@4315,registry:Version@4460,registry:Version@4750,whole:Route@1341,whole:Route@1348,whole:Route@1429,whole:Route@1437,whole:Route@1503,whole:Route@1623,whole:Route@1737,whole:Route@1844,whole:Route@259,whole:Route@2878,whole:Route@2885,whole:Route@293,whole:Route@333,whole:Route@3497,whole:Route@3584,whole:Route@4024,whole:Route@4110,whole:Route@4700,whole:Route@4844,whole:Route@4851,whole:Route@5074,whole:Route@5228,whole:Route@5332,whole:Route@5339,whole:Route@540,whole:Route@597,whole:Route@646,whole:Route@661 5feaf2e3e8d7f3c6a2cd2b86aa837bd926d26913dc4a79ae473c5af7a8e50c6b |
| -@legacy 7b5b0dbba2a0c01a06bcf560f831100d14f795d80f46514c96b06e903cda8099 internal/activator/statelessrelease.go Service.prepareStatelessRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task1;basis=The former PrepareStatelessRelease body. R9: adopts the record's attempt for this lifetime and target in every phase before any coordination; otherwise acquires the term first and only then selects the ID (R1); a begin carries RetryOf only when consuming a durable retry. Same calls (ObserveReplicaRelease, coordinator, escrow initializer, actEntry, runReleaseAdmitted); same gates, proof and SafeUntil checks; no new store read or writer.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: refuses with provision.ErrReplicaSwitchOpen (SR-4-C31) before term acquisition when the observed record already has an unresolved copy-switch permit, instead of a begin the writer refuses and that read as an unknown result. Refusal only; same calls, no read added.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix rounds 1-2 (#511 F11): R9 adoption moves into adoptDurable (same phases, same escrow initializer call). A begin, or the unknown close of an observed releasing attempt, that does not go through goes to refusedStep: a writer refusal (replicas.ReleaseRefused, record read by the adapter in the same call) re-runs adoptDurable once with no read of its own; anything else maps through stepError. A failed releasing write before the exec maps through stepError too. ErrReplicaReleaseUnknown stays only where a release command's result is unknown (an open release record, a successful close of this attempt, and the post-exec paths). The exec's fresh record check stays the final gate. The added sites pass the handed route to adoptDurable and refusedStep. No new store read or write. registry:Account@634,registry:App@664,registry:GoodDemand@4280,registry:GoodDigest@4265,registry:GoodVersion@4249,registry:Host@1252,registry:Host@301,registry:Host@4336,registry:Host@4394,registry:Host@4610,registry:Host@4678,registry:Host@691,whole:Route@3452,whole:Route@4064,whole:Route@4403,whole:Route@4410,whole:Route@4962,whole:Route@569,whole:Route@860 42558a4357333562c9ff000a426ca241ccb57706419a7638a8705d3872b58f5a |
| +@legacy c4caa8b05acdcc38fac36d3ed442d47c63105dedeb1a5c82b7a43e6dcaba9da3 internal/activator/statelessrelease.go Service.prepareStatelessRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task1;basis=The former PrepareStatelessRelease body. R9: adopts the record's attempt for this lifetime and target in every phase before any coordination; otherwise acquires the term first and only then selects the ID (R1); a begin carries RetryOf only when consuming a durable retry. Same calls (ObserveReplicaRelease, coordinator, escrow initializer, actEntry, runReleaseAdmitted); same gates, proof and SafeUntil checks; no new store read or writer.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: refuses with provision.ErrReplicaSwitchOpen (SR-4-C31) before term acquisition when the observed record already has an unresolved copy-switch permit, instead of a begin the writer refuses and that read as an unknown result. Refusal only; same calls, no read added.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix rounds 1-3 (#511 F11): R9 adoption moves into adoptDurable. A begin, or the unknown close of an observed releasing attempt, that does not go through goes to refusedStep: a writer refusal (replicas.ReleaseRefused, record read by the adapter in the same call) re-runs adoptDurable once with no read of its own; anything else maps through stepError. Fix round 3: before the releasing write it saves this box's mark (MarkReplicaRelease: attempt ID and term), and after it, just before the exec, Started; a close or an in-call unknown of an attempt this box knows never started returns errReplicaReleaseNotStarted (SR-4-C59) and saves Closed. The record still closes as unknown. The marks are this box's own failure-book file (no store read or write); the exec's fresh record check stays the final gate. registry:Account@634,registry:App@664,registry:GoodDemand@4568,registry:GoodDigest@4553,registry:GoodVersion@4537,registry:Host@1252,registry:Host@301,registry:Host@4624,registry:Host@4682,registry:Host@4898,registry:Host@4966,registry:Host@691,whole:Route@3452,whole:Route@4352,whole:Route@4691,whole:Route@4698,whole:Route@5395,whole:Route@569,whole:Route@860 e4f07177255b79e88cfa28dec4b980993e776ee7180787ea14cf4dc042d60a71 |
| +internal/activator/activator.go type Service authority B,C,D,F,J4 rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b3a;basis=Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Add coordinator, existing-record observation callback and per-host preparation locks; no read in the declaration. Task 3a: Add optional canonical storage-selection and durable deploy-ID callbacks; declaration only, no read or authority in these fields.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds the heldLegs map to actEntry (legs by id, under a.mu) and heldWakeHook (atomic pointer to a callback) and heldLegSeq (atomic counter) to Service. State only, in memory; no read of tenant, app or box-agent-writable input.;rev3=census-ruling-wake-storm-cap;basis=the agent as carlos: one field, wakeSlots (chan struct{}, the wake semaphore made by New from Config.WakeSlots, default 4); declaration only, no read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Add the B2 DutyStore interface field and process-local duty view, suppression and invalidation state. No read added. B2 adds the verified-successor identity callback; no read in the declaration. B3b adds a nonblocking departure-suspicion callback, invoked only after an accepted holder-forward failure and after cache locks release; it cannot authorize a take.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: immutable callbacks installed before Start for tenant admission, local start permission, fixed route exemptions and shutdown closure; nil callbacks preserve switch-off behavior; no new reads. Fix R1: add an immutable startup-phase callback for response copy, set before service startup. No new read or execution authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Add in-memory HA loss state and pool withdrawal jobs; no new read.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 1: one new field, drain (drainSources: two atomic func pointers for this box's and peers' drain state); no read added. region HA held-requests Task 2: one new field, moves (moveTable: per-host move state, hold counts and admission tickets in memory, under mu); no read added;rev3=census-ruling-held-move-speed;basis=the agent as carlos: one new field, moveStreams (per-host in-memory set of edge.StreamEnd for requests in flight, own mutex), for the move's early stream cut; actEntry gains drainRelease (bool, under a.mu), set by DrainStop; declarations only, no read added;rev3=census-ruling-fix-silent-start-kill-861;basis=#861: two fields, wakeFailMu and wakeFailLogged (per-host in-memory note of the last journalled wake failure); declaration only, no read;rev3=census-ruling-w6-ingress-drain;basis=new field TenantStartsClosed func() bool; when it answers true tenantStartRefusal refuses every start, exempt routes included. Wired only by fixedAdmission.bind to the ingress drain's closed flag. Struct field only; no read added.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: one field, replicaPolicies (host to the newest observed replica deploy and this box label, under mu), set only by SetReplicaDeploy; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: one more in-memory field, replicaFailed (host to the permit whose successor failed here, under mu), so that step only proves what it kept; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): two hook fields, MarkReplicaRelease and ReplicaReleaseMark (the failure book's per-host release mark on this box's disk). No read site. 38c5119290680f79501717877f561bade1c581925a4cc0b90aae488d8e6499b4 |
| internal/activator/stateless.go Service.statelessCurrent legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Recheck current registry launch inputs and fresh record lifetime against the attempt observation without a serving lease; refuse changed configuration or missing evidence. No writes; runtime caller remains to be wired. Fix 3a round 1 I2: repeated gates inspect only the current registry row and attempt-local observation. Fresh record validation moved, not removed: statelessFinalRecord at final backend exec gate. All launch-shape and lifecycle row checks retained.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 1 (#511 F11): its two route refusals return errStatelessRowChanged (SR-4-C58), a value that is ErrFenced to every errors.Is caller but names no fence. Same reads and comparisons; refusal text only. registry:Args@467,registry:Args@478,registry:Caps@444,registry:Caps@455,registry:Channel@378,registry:Channel@392,registry:CreatedAt@490,registry:CreatedAt@506,registry:Environment@407,registry:Environment@425,registry:Host@204,registry:Stateless@523,registry:Stateless@539,whole:Route@275,whole:Route@279,whole:Route@348,whole:Route@370,whole:Route@667,whole:Route@679,whole:Route@763 bb80cfe535efc3a5b30d4a81ab759242e46dc6fd7bc41de9638e8c01f74cc4dc |
| +internal/activator/swap.go Service.Swap legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Verify the target canonical mode and prepare its durable stateless release before stopping the incumbent. A mode change forces the existing proven hold path; same-mode stateless overlap uses local lifecycle gates and the final current-record check, without a serving lease. CI fix 1: defer a missing registry row to the existing release checks only for stateful rootfs overlap, preserving disabled/newest checks and committedGood refusal. Stateless modes, transitions, binary/foreign/hold paths still fence before preparation. No new reads. Final review C1/R26: include incumbent Gen.Stateless as declaration evidence, so only matching good stateful recovery/config attempts can skip canonical lookup. Fresh route, release, ownership and stop gates unchanged.;rev3=census-ruling-stateless-failed-release-held;basis=Classify a proven stateless release failure, or the same deploy's durable failed or unknown phase, through the existing SwapFailed hold mechanism. Preparation precedes stopping the incumbent, so report overlap semantics even if the requested swap is hold. Stateful path unchanged; no new root input.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: for a set row (route FleetBoxes), refuses a stateful or non-overlap attempt before preparation, and a build the observed policy does not allow after it; refusals only, the route read is the row Swap already reads.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: a set row whose incumbent is not stateless is refused (errReplicaHold) before preparation, so the mode-change hold conversion below can never run a set row as a hold; with replicaSwapRefusal this keeps every set row off swapHold and releaseBeforeSwap. Refusal only, no read added.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): an adopted attempt this box knows never started (errReplicaReleaseNotStartedHeld) holds the deploy as the adopted unknown phase did (SwapFailed). Error classification only; same reads. registry:FleetBoxes@1723,registry:Stateless@1340,registry:Stateless@1369,whole:Route@1013,whole:Route@1063,whole:Route@1072,whole:Route@1257,whole:Route@1333,whole:Route@1446,whole:Route@1690,whole:Route@2254,whole:Route@2777,whole:Route@3195,whole:Route@785,whole:Route@801 0e88a84a74bc36696eeae06ab7237aca3281345c0a6a416dec7a7bc7f35d1118 |
| +internal/host/rollout.go armRollout legacy accepted-legacy accepted-legacy;rev3=fix1-merge-review;basis=Comment-only clarification of failure-book saves; existing agent rollout setup remains legacy.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: after the overlap scheduler arms, calls svc.ArmRootfs() so rootfs rows start only where the scheduler armed this boot; never on the refuseManaged path; no read added;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Bind Service.ReplicaDeployID to the same FailureBook the scheduler owns and bind RuntimeSelection to one CanonicalStatelessDigest read through the existing store. Fix 3a round 1 R18: canonical selection receives route stateless projection to keep legacy DemandHold fallback only for stateful/unknown builds; staged digest mismatch still refuses.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: the scheduler box label is rolloutBox(svc): the fleet identity label already on svc.Fleet (set from identity.Label before the scheduler arms), else BoxLabel() as before. No read added.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): also hands the failure book's MarkReplicaRelease and ReplicaReleaseMark to the activator, beside ReplicaDeployID. The book is the same file the agent already opened; no new read. registry:App@3016,registry:Stateless@3035,whole:Route@3011,whole:Route@3703,whole:Route@3787 e2f344b05be5995514f4c1a6f84a45c6b1508bf70c23fef9f0425e612fa8e1a2 |
| +internal/rollout/failures.go FailureBook.saveLocked authority E3 rev3=PROPOSED-p3;run=8;identity=root adoption uid 0 or legacy rollout uid carlos;basis=root instance uses checked store writer; legacy instances retain the original atomic file writer and epoch semantics;rev3=census-ruling-stateless-replicas-1;basis=Persist the additive replica_releases selection carrier in the existing failure-book atomic write; no new path, record writer or authority. IDs are returned only after a successful save.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): the saved failure file also carries the replica release marks (additive key replica_release_marks). Same write path and file. e1fd033f83db57b6d1d90457c608fb53178126f9a22120c41d008530c6b9fde5 |
| +internal/rollout/failures.go OpenFailureBook authority E1,E3,J1,J4 fix1-merge-review;basis=Loads schema-three durable generations and refuses unsafe identity recovery on entropy failure.;rev3=census-ruling-stateless-replicas-1;basis=Load the additive replica_releases carrier from the same existing failure-book ReadFile; unchanged schema acceptance, identity recovery, reconciliation and read site. No additional read.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): loads the additive replica_release_marks key from the same file it already reads. No new read. file:ReadFile@136 4b4d3634b040cfe5a6b5741451cff618b90ccc84b84df6bf06c8d43b56df783d |
| internal/activator/stateless.go sameRowLifetime legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 1 (#511 F11): new. Compares four fields (Incarnation, ServingSeq, HoldOp, Version) of two in-memory route rows it is handed; no read, write or authority. registry:HoldOp@153,registry:HoldOp@172,registry:Incarnation@67,registry:Incarnation@91,registry:ServingSeq@111,registry:ServingSeq@134,registry:Version@187,registry:Version@207 8cc7ffa914050e09404a4e4a13657db356014ff97cca8cc641dafdaa16a1d6cc |
| -internal/activator/statelessrelease.go Service.adoptDurable legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 1 (#511 F11): new; the R9 adoption switch moved out of prepareStatelessRelease unchanged: DurableAttempt on the attempt it is handed, then the same escrow initializer call (prepareStatelessEscrow) for a passed release, or the failed or unknown sentinel. No new read, write or authority. whole:Route@459 4c32b8d100a319d2a099db1faa9f36b40fedf095583a6ff30ec5ad1345cc41c8 |
| +internal/activator/statelessrelease.go Service.adoptDurable legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix rounds 1 and 3 (#511 F11): new; the R9 adoption switch moved out of prepareStatelessRelease: DurableAttempt on the attempt it is handed, then the same escrow initializer call for a passed release, or the failed or unknown sentinel. Fix round 3: an unknown phase of an attempt this box closed knowing it never started (its own mark) reads as errReplicaReleaseNotStartedHeld. No store read, write or authority. whole:Route@459 b47c243ad268145b8c29f561251c6cb6a5b83b0e28abf6270395a9c440945cb5 |
| internal/activator/statelessrelease.go Service.refusedStep legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix rounds 1-2 (#511 F11): new. For a writer refusal (replicas.ReleaseRefused) it calls adoptDurable once on the record attempt the refusal carries; otherwise, or when nothing adopts, it returns stepError's ran-nothing sentinel (an unreachable console keeps its own error). It reads only the handed route and error; no store read, write or authority. whole:Route@277 78b6a7ec4509bcccbd6640f4cf657994749b19e01f0116e0d8398668ecc610de |
| internal/activator/stateless.go Service.prepareStateless legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Capture RecordFacts from the existing record source, obtain the durable FailureBook deploy ID, and call Task 2 PrepareStatelessRelease with the canonical verdict/digest carrier. Carry a successful attempt through its hold only after another current-record check; no serving lease or polling loop. Fix 3a round 1 I2: preparation uses reconcile observations and records the successful deploy ID. Carry prepared evidence through hold; fresh backend read must confirm that same released deploy before web runs.;rev3=census-ruling-stateless-failed-release-held;basis=For recovery onto a different installed version's exact committed good version and artifact digest, retain recovery evidence without selecting or writing another deploy. Adds the existing committedGood registry read, with its route and incarnation check. Canonical storage declaration and observed lifetime gates remain.;rev3=census-ruling-stateless-replicas-4-task1;basis=R1: no longer calls ReplicaDeployID before preparation; hands the same a.ReplicaDeployID selector to prepareStatelessRelease, which calls it only after coordinator term acquisition. The ObservedReplicaRelease call stays as a validity check. Same read sites; no new read, write or authority.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2 (D4): for a set row, prepares the record baseline with no release, and refuses a build the row Version does not name before any release; reads the route it is handed (FleetBoxes, Version). No store read or write added.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: for a set row, a build its pointer does not name starts only as the record baseline or the committed permitted target, the latter adopted through prepareStatelessRelease durable path (never a new attempt); a named build, a rollback included, takes the release path. The added reads are the handed route (FleetBoxes, Version) and a copy of it with Stateless set for the adoption, as the release path already builds. No store read or write added.;rev3=census-ruling-stateless-replicas-4-task2-fix2;basis=Task 2 fix round 2: for a set row the no-release start is decided per box from the record (this box baseline, or its permitted target adopted through the durable path), whatever the pointer says; only a build that is neither and that the pointer names begins a new attempt. Same reads (the handed route and its copy); no store read or write added.;rev3=census-ruling-stateless-replicas-4-task2-fix3;basis=Task 2 fix round 3: this box baseline is checked before the adopt path, so a completed box restarts on the target while a retry is requested; for the passed target it calls the existing escrow initializer (prepareStatelessEscrow) that the adopt path ran, with the same route and identity. No new reader; no record write.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F (#511 F11): a hold's pinned wake carrying the swap's preparation, when the row it re-read differs from the prepared row, moves the preparation onto the wake's row only if the prepared row passes statelessCurrent against the registry, the two rows have the same Incarnation, ServingSeq, HoldOp and Version (sameRowLifetime, fix round 1), and the wake's row then passes statelessCurrent; otherwise it refuses with errStatelessRowChanged. The added sites are whole-Route comparisons and copies of the handed and prepared routes. No store read or write added; no new authority. registry:Account@284,registry:Account@310,registry:App@324,registry:App@346,registry:Digest@4780,registry:FleetBoxes@1967,registry:FleetBoxes@4423,registry:Host@250,registry:Host@273,registry:Stateless@3505,registry:Stateless@4030,registry:Stateless@5078,registry:Version@4315,registry:Version@4460,registry:Version@4750,whole:Route@1341,whole:Route@1348,whole:Route@1429,whole:Route@1437,whole:Route@1503,whole:Route@1623,whole:Route@1737,whole:Route@1844,whole:Route@259,whole:Route@2878,whole:Route@2885,whole:Route@293,whole:Route@333,whole:Route@3497,whole:Route@3584,whole:Route@4024,whole:Route@4110,whole:Route@4700,whole:Route@4844,whole:Route@4851,whole:Route@5074,whole:Route@5228,whole:Route@5332,whole:Route@5339,whole:Route@540,whole:Route@597,whole:Route@646,whole:Route@661 5feaf2e3e8d7f3c6a2cd2b86aa837bd926d26913dc4a79ae473c5af7a8e50c6b |
| -internal/activator/statelessrelease.go Service.prepareStatelessRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task1;basis=The former PrepareStatelessRelease body. R9: adopts the record's attempt for this lifetime and target in every phase before any coordination; otherwise acquires the term first and only then selects the ID (R1); a begin carries RetryOf only when consuming a durable retry. Same calls (ObserveReplicaRelease, coordinator, escrow initializer, actEntry, runReleaseAdmitted); same gates, proof and SafeUntil checks; no new store read or writer.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: refuses with provision.ErrReplicaSwitchOpen (SR-4-C31) before term acquisition when the observed record already has an unresolved copy-switch permit, instead of a begin the writer refuses and that read as an unknown result. Refusal only; same calls, no read added.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix rounds 1-2 (#511 F11): R9 adoption moves into adoptDurable (same phases, same escrow initializer call). A begin, or the unknown close of an observed releasing attempt, that does not go through goes to refusedStep: a writer refusal (replicas.ReleaseRefused, record read by the adapter in the same call) re-runs adoptDurable once with no read of its own; anything else maps through stepError. A failed releasing write before the exec maps through stepError too. ErrReplicaReleaseUnknown stays only where a release command's result is unknown (an open release record, a successful close of this attempt, and the post-exec paths). The exec's fresh record check stays the final gate. The added sites pass the handed route to adoptDurable and refusedStep. No new store read or write. registry:Account@634,registry:App@664,registry:GoodDemand@4280,registry:GoodDigest@4265,registry:GoodVersion@4249,registry:Host@1252,registry:Host@301,registry:Host@4336,registry:Host@4394,registry:Host@4610,registry:Host@4678,registry:Host@691,whole:Route@3452,whole:Route@4064,whole:Route@4403,whole:Route@4410,whole:Route@4962,whole:Route@569,whole:Route@860 42558a4357333562c9ff000a426ca241ccb57706419a7638a8705d3872b58f5a |
| -@coverage internal/activator 62059fba28f1ee506df8f0b49f34eb4b5b4930b408935af53f8b7fa94c364ab7 |
| -@coverage internal/host 235567aa39cdd23237c87b083d47b02c77c7499a58c7faec25116a1e12bf57e0 |
| -@coverage internal/replicas 28b9161fa88128b941039eae68ef9948856435e4d29a2cda3af2f1d50ae907c9 |
| +internal/activator/statelessrelease.go Service.prepareStatelessRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-4-task1;basis=The former PrepareStatelessRelease body. R9: adopts the record's attempt for this lifetime and target in every phase before any coordination; otherwise acquires the term first and only then selects the ID (R1); a begin carries RetryOf only when consuming a durable retry. Same calls (ObserveReplicaRelease, coordinator, escrow initializer, actEntry, runReleaseAdmitted); same gates, proof and SafeUntil checks; no new store read or writer.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: refuses with provision.ErrReplicaSwitchOpen (SR-4-C31) before term acquisition when the observed record already has an unresolved copy-switch permit, instead of a begin the writer refuses and that read as an unknown result. Refusal only; same calls, no read added.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix rounds 1-3 (#511 F11): R9 adoption moves into adoptDurable. A begin, or the unknown close of an observed releasing attempt, that does not go through goes to refusedStep: a writer refusal (replicas.ReleaseRefused, record read by the adapter in the same call) re-runs adoptDurable once with no read of its own; anything else maps through stepError. Fix round 3: before the releasing write it saves this box's mark (MarkReplicaRelease: attempt ID and term), and after it, just before the exec, Started; a close or an in-call unknown of an attempt this box knows never started returns errReplicaReleaseNotStarted (SR-4-C59) and saves Closed. The record still closes as unknown. The marks are this box's own failure-book file (no store read or write); the exec's fresh record check stays the final gate. registry:Account@634,registry:App@664,registry:GoodDemand@4568,registry:GoodDigest@4553,registry:GoodVersion@4537,registry:Host@1252,registry:Host@301,registry:Host@4624,registry:Host@4682,registry:Host@4898,registry:Host@4966,registry:Host@691,whole:Route@3452,whole:Route@4352,whole:Route@4691,whole:Route@4698,whole:Route@5395,whole:Route@569,whole:Route@860 e4f07177255b79e88cfa28dec4b980993e776ee7180787ea14cf4dc042d60a71 |
| +@coverage internal/activator 540c65c5ce229d67d237ae56171c6a7a2753cd2e026e1a1f76907c3e06285d87 |
| +@coverage internal/host dd433cd2454b571ee0e15c1a7964355c5fedd3dd651e1f127d39079adb98b0ef |
| +@coverage internal/replicas c61842f45754dd1e1ea266520bdb90b4eca5e25ba80118c948430cc89152c1b7 |
| +@coverage internal/rollout a88d06d23773f10597475d62c1e332c06cd73372479fbb90dabcec322241cc2d |
diff --git a/internal/replicas/types.go b/internal/replicas/types.go| index 51c94869a..fdd776294 100644 |
| --- a/internal/replicas/types.go |
| +++ b/internal/replicas/types.go |
| @@ -59,6 +59,19 @@ type ReleaseRefused struct { |
| func (e *ReleaseRefused) Error() string { return e.Err.Error() } |
| func (e *ReleaseRefused) Unwrap() error { return e.Err } |
| +// ReleaseMark is a box's own evidence of one release attempt it moved to |
| +// releasing (#511 F11): the attempt ID and the term it wrote releasing |
| +// under, whether it then reached the command's exec (Started), and whether |
| +// it later closed that attempt as unknown knowing the command never started |
| +// here (Closed). A box keeps one per host, on its own disk; it is never on |
| +// the record. |
| +type ReleaseMark struct { |
| + ID string `json:"id"` |
| + Term string `json:"term"` |
| + Started bool `json:"started,omitempty"` |
| + Closed bool `json:"closed,omitempty"` |
| +} |
| + |
| type Authority interface { |
| Err() error |
| Lost() <-chan struct{} |
diff --git a/internal/rollout/failures.go b/internal/rollout/failures.go| index 75d8fe36b..17c794c3f 100644 |
| --- a/internal/rollout/failures.go |
| +++ b/internal/rollout/failures.go |
| @@ -236,10 +236,20 @@ type replicaReleaseSelection struct { |
| RetryOf string `json:"retry_of,omitempty"` |
| } |
| +// replicaReleaseMark is a host's replicas.ReleaseMark with the lifetime it |
| +// belongs to. |
| +type replicaReleaseMark struct { |
| + Identity replicas.Identity `json:"identity"` |
| + replicas.ReleaseMark |
| +} |
| + |
| type failureFile struct { |
| ReplicaReleases map[string]replicaReleaseSelection `json:"replica_releases,omitempty"` |
| - Schema int `json:"schema"` |
| - Records []FailureRecord `json:"records"` |
| + // ReplicaMarks is additive to schema 3: an agent that predates it |
| + // ignores the key, and a file without it has no marks. |
| + ReplicaMarks map[string]replicaReleaseMark `json:"replica_release_marks,omitempty"` |
| + Schema int `json:"schema"` |
| + Records []FailureRecord `json:"records"` |
| // HoldRan is the hold-ran markers by host. It is additive to schema 1: an |
| // agent that predates it ignores the key (encoding/json skips unknown |
| // fields), and a file without it has no markers. |
| @@ -388,6 +398,7 @@ func genKey(acct, app string) string { return acct + "/" + app } |
| // identity: drop the file's "book" key, and the open makes one (rule 4). |
| type FailureBook struct { |
| replicaReleases map[string]replicaReleaseSelection |
| + replicaMarks map[string]replicaReleaseMark |
| write func([]byte) error |
| path string |
| mu sync.Mutex |
| @@ -536,6 +547,7 @@ func OpenFailureBook(dataDir string) (*FailureBook, error) { |
| return nil, fmt.Errorf("%s: unknown schema %d", b.path, f.Schema) |
| } |
| b.replicaReleases = f.ReplicaReleases |
| + b.replicaMarks = f.ReplicaMarks |
| b.recs = f.Records |
| b.held = f.HoldRan |
| b.intents = f.Intents |
| @@ -754,7 +766,7 @@ func (b *FailureBook) saveLocked() error { |
| return nil |
| } |
| raw, err := json.MarshalIndent(failureFile{Schema: failureSchema, Records: b.recs, HoldRan: b.held, Seq: b.seq, Intents: b.intents, |
| - Book: b.idLocked(), Gens: b.gens, Durable: true, ReplicaReleases: b.replicaReleases}, "", " ") |
| + Book: b.idLocked(), Gens: b.gens, Durable: true, ReplicaReleases: b.replicaReleases, ReplicaMarks: b.replicaMarks}, "", " ") |
| if err == nil { |
| if b.write != nil { |
| err = b.write(raw) |
| @@ -1328,6 +1340,48 @@ func (b *FailureBook) List() []FailureRecord { |
| return out |
| } |
| +// MarkReplicaRelease saves this box's evidence of a release attempt it |
| +// moves to releasing (#511 F11), replacing the host's earlier mark. It is |
| +// durable when it returns nil; a failed save leaves the book's mark as it |
| +// was, and the caller runs nothing. |
| +func (b *FailureBook) MarkReplicaRelease(id replicas.Identity, mark replicas.ReleaseMark) error { |
| + b.mu.Lock() |
| + defer b.mu.Unlock() |
| + if id.Host == "" || id.Incarnation == "" || mark.ID == "" || mark.Term == "" { |
| + return replicas.ErrInvalid |
| + } |
| + if err := b.retryLocked(); err != nil { |
| + return err |
| + } |
| + prev, had := b.replicaMarks[id.Host] |
| + if b.replicaMarks == nil { |
| + b.replicaMarks = map[string]replicaReleaseMark{} |
| + } |
| + b.replicaMarks[id.Host] = replicaReleaseMark{Identity: id, ReleaseMark: mark} |
| + if err := b.saveLocked(); err != nil { |
| + if had { |
| + b.replicaMarks[id.Host] = prev |
| + } else { |
| + delete(b.replicaMarks, id.Host) |
| + } |
| + // The earlier state is what the disk holds; nothing is owed. |
| + b.dirty = false |
| + return err |
| + } |
| + return nil |
| +} |
| + |
| +// ReplicaReleaseMark is this box's mark for the lifetime id, if it has one. |
| +func (b *FailureBook) ReplicaReleaseMark(id replicas.Identity) (replicas.ReleaseMark, bool) { |
| + b.mu.Lock() |
| + defer b.mu.Unlock() |
| + m, ok := b.replicaMarks[id.Host] |
| + if !ok || m.Identity != id { |
| + return replicas.ReleaseMark{}, false |
| + } |
| + return m.ReleaseMark, true |
| +} |
| + |
| // ReplicaDeployID persists the release attempt the coordinator term holder |
| // uses. The record's attempt for this lifetime and target always wins, in |
| // every phase, and overwrites the local selection (R9). Only a changed |
diff --git a/internal/rollout/replica_release_mark_test.go b/internal/rollout/replica_release_mark_test.go| new file mode 100644 |
| index 000000000..5694a41ba |
| --- /dev/null |
| +++ b/internal/rollout/replica_release_mark_test.go |
| @@ -0,0 +1,48 @@ |
| +package rollout |
| + |
| +import ( |
| + "errors" |
| + "testing" |
| + |
| + "github.com/carlosframework/platform/internal/replicas" |
| +) |
| + |
| +// TestReplicaReleaseMarkSurvivesRestart is #511 F11 fix round 3: the box's |
| +// own evidence of a release attempt it moved to releasing is durable when |
| +// the mark returns, belongs to one lifetime, and a failed save leaves the |
| +// earlier mark in force. |
| +func TestReplicaReleaseMarkSurvivesRestart(t *testing.T) { |
| + dir := t.TempDir() |
| + b, err := OpenFailureBook(dir) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + id := replicas.Identity{Account: "bab", App: "shop", Host: "example.com", Incarnation: "lifetime"} |
| + written := replicas.ReleaseMark{ID: "deploy", Term: "term"} |
| + if err := b.MarkReplicaRelease(id, written); err != nil { |
| + t.Fatal(err) |
| + } |
| + b.write = func([]byte) error { return errors.New("save refused") } |
| + if err := b.MarkReplicaRelease(id, replicas.ReleaseMark{ID: "deploy", Term: "term", Started: true}); err == nil { |
| + t.Fatal("unsaved mark accepted") |
| + } |
| + if got, ok := b.ReplicaReleaseMark(id); !ok || got != written { |
| + t.Fatalf("failed save changed the mark: %+v %v", got, ok) |
| + } |
| + b.write = nil |
| + b, err = OpenFailureBook(dir) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if got, ok := b.ReplicaReleaseMark(id); !ok || got != written { |
| + t.Fatalf("after restart: %+v %v", got, ok) |
| + } |
| + other := id |
| + other.Incarnation = "another" |
| + if _, ok := b.ReplicaReleaseMark(other); ok { |
| + t.Fatal("another lifetime read this mark") |
| + } |
| + if err := b.MarkReplicaRelease(id, replicas.ReleaseMark{ID: "deploy"}); !errors.Is(err, replicas.ErrInvalid) { |
| + t.Fatalf("mark without a term: %v", err) |
| + } |
| +} |