Repository navigation
pool: an env write on an archived claim replaces its failover row - #422
Merged
Merged
Conversation
A rotation stayed in the local journal, so after node loss an adopter started from the row's old credential and the old value stayed in the database. The write now replaces the row. With the registry down it answers 503 with the local record changed, and a resend repairs the row, as it does a failed guest write. A row another node took drops the claim. Hot path: none, only a claim with a row pays.
…over row Replication rounds do not run while a claim is hibernated, so a rotation answered there stayed in the local journal and an adopter started from the replica row's old value, with no time bound. The write now replaces the row at its replica checkpoint, as it does for an archived claim. A running replicated claim keeps getting its env through the next round.
Rounds skip hibernated claims, so a renew there left the row's lease and on_expire as they were for as long as the claim slept, and an adopter after node loss restored the old values: a renewed on_expire archive came back as destroy. The renew now replaces the row at its replica checkpoint, as an env write does; with the registry down it answers 503 with the local lease already granted, and a resend repairs the row. A running replicated claim keeps getting its lease through the next round.
CMGS
force-pushed
the
fix/archive-env-row
branch
from
November 3, 2026 08:24
829354f to
2bbecd6
Compare
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
PATCHorPUTof/envon an archived claim stayed in the local journal. Witharchive_failover, the row an adopter starts from kept the value from the archive, so after node loss the claim went back to the old credential, and the old value stayed in the database.The write now replaces the row, with these outcomes:
The row still holds the env in plaintext. Encrypting it is a separate question, in #423.
Hot path: none. Only a claim with a row writes one. Running and hibernated claims make no registry call, and a test asserts that.
Known residue: a write landing in the milliseconds between an archive's row write and the claim taking its checkpoint id reaches the journal but not the row. It needs a rotation inside that window and then a node loss before the next write. No mechanism is added for it.
Evidence: tests cover each case above and the adopter holding the rotated value. Mutants, each from a saved copy: without the row write, 5 tests fail (
adopter holds "old", want the rotated value), and without the stale-epoch retry, 2 fail (row env "new", want newer).go test ./pool ./server ./types,-race ./pool, the changed tests-race -count=20,go veton both GOOS and the e2e module's tests pass.Hardware: two bare-metal nodes, a real PostgreSQL, S3-compatible storage, cocoon v0.7.1, at this PR's head, n=1 per step:
newer, and the guest env held noGH_TOKEN.sandboxd_archivesstatement (log_statement='mod'), and the last value still reached an injected request.Two details from that run, both as designed:
Deadline, because an archive's first row computes it separately. It then holds across later rewrites and the adoption. A claim kept forever stays at null.Not run: a rotation inside an in-flight wake on hardware (a test covers it), and any cocoon other than v0.7.1.
Stacked on #420.
Update
on_expire. Replication rounds skip hibernated claims, so nothing else would. With the registry down the call answers 503 and a resend repairs the row. A running replicated claim stays on the round.