Repository navigation
feat(duckfleet): recover remote attempts from evidence, never replay - #1157
Merged
Merged
Conversation
7 tasks
Owner
Author
|
Recovery investigation update:
|
Owner
Author
|
Claim handed over to Claude Code session |
…sion 01a1fb62) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dence Remote task sessions journal their session and every request id before it is sent; a refused journal sends nothing further. The recovery module reads durable upstream request records and the lake publication receipt, and decide() is the failure matrix. Job claim refuses any writer for a dataset with an unresolved remote attempt. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The golden task acquires a dataset fence over the attempt channel before opening a session, journals every request id before sending it, tags the publishing commit with a lake receipt, and settles the fence from what it observed. Attempts it cannot settle are reconciled by a dispatcher sweep from the pinned binding's durable request records and the receipt. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
An in-test relay loses a COMMIT reply after it landed, and drops a COMMIT before it reaches the gateway. Both jobs fail truthfully with the dataset held; the sweep settles them committed (one receipt) and rolled back. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t test's run time Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ribute bounds Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
marked this pull request as ready for review
November 21, 2026 16:49
athvin
temporarily deployed
to
marketing-preview
November 21, 2026 16:56 — with
GitHub Actions
Inactive
This was referenced Nov 21, 2026
This branch was previously deployed
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.
Closes #1133
What
A remote golden attempt now holds a dataset fence (
remote_attempts) from before its session opens until its publication outcome is established. It journals every request id over the attempt channel before sending it, and tags the publishing commit with a lake receipt. Anything the pod cannot settle is reconciled by a dispatcher sweep from DuckFleet's durable request records and the receipt. Nothing is replayed.job/update/claim.sqladmits no writer of any backend for a held dataset.Why
#1133: after a transport loss, cancellation or worker loss around COMMIT, the job must report a truthful outcome. No retry, re-run or embedded run may race a commit that might still land, and nothing may re-execute SQL to find out what happened.
Proof
make check: see the Context block for the run on the final head.pg_remote_attempt_fence(real Postgres): scope comes from the token, stale pods and relaunches are refused, COMMIT is journaled once, every writer is held, and the sweep releases only on conclusive evidence.make check-duckfleet-task(real DuckFleet at the pinned revision). Owner release iscommittedwith exactly one receipt. Then two COMMIT faults through an in-test relay. When the reply is lost after COMMIT landed, the job fails and the dataset is held; the sweep finds the receipt and settlescommitted, with exactly one publication. When the COMMIT never reaches the gateway, the job fails and the dataset is held; the sweep settlesrolled_back, with the lake unchanged.er-duckfleetunit tests: journal ordering and refusal, loss during temp work, during writes and around COMMIT, cancellation with acknowledged close, and one test perdeciderow.Risk & rollback
Default-off. Only a task pod with
ER_DUCKFLEET_TASK_POLICYjournals, and nothing is enrolled.claim.sqlgains oneNOT EXISTSagainst an empty table.git revert <merge-sha>is an acceptable rollback. An attempt row left unresolved by a revert would hold its dataset; release it after checking the receipt.Post-merge ledger
Closed by: agent · session
Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306onbrians-MacBook-Pro· 2026-11-21T17:07:16Zmainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not:
f5aa9a86. rust 44927305240, frontend 44927305149, infra 44927305141, devcontainer 44927305212, marketing preview 44927305255 all success; baselineb784c21awas all greenimagesbuilt, or correctly never ran because nothing that goes intoan image changed: images 44927305177 success on
f5aa9a86deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: blocked (prod only) — dev proven: new pod
ci/web-api-blue-f645f9bb9-txvdlemitteder-server listeningat 2026-11-21T17:00:51Z, after the deploy began at 16:59; boot reconciles the schema before listening. Prod not read: theathvin-prodkubectl context hung on auth and this session has no CloudWatch path. Observed so far: deploy 44927547497 success withDEPLOY_SHA=f5aa9a86for prod and dev; cutover logged "traffic is verified on green" (prod) and "on blue" (dev);https://dupezero.com/api/healthzreturned{"ready":true,"upstream":"ok"}. Unblock: read er-server's startup or schema-reconcile log line for the new pods in CloudWatchdeploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: deploy green (above).
driftand nightlykinddid not run on this SHA; kind has been red since 2026-11-10 for an undiagnosed cause tracked in kind probe red since 2026-11-10: KeyError 'token_hash' after the credential-omission fix #1106, which predates this changeDonethrough the automation rather than byhand, and the issue closed: DuckFleet: recover remote jobs safely after cancellation or worker loss #1133 CLOSED,
closer= PullRequest feat(duckfleet): recover remote attempts from evidence, never replay #1157; card StatusDone(a skill, a reference, memory) — or nothing new was learned:
ducklake-lakehouse/references/duckfleet-recovery.md(fence, journal, receipt, matrix, bounds); theDATASET_SCOPEDtrap is already in memorySpecific to this change
remote_attemptson dev and prod (a log line or a read of the table), and the claim still dispatches there: blocked — the table was not read directly in either environment. Dev's new pod reacheder-server listening, and the new pods serving traffic in both implies boot reconciliation succeeded (a breaking diff refuses to start), but nothing read the table or a log lineContext — plan, discoveries, measurements, files
Plan
Taken over from Codex session
01a1fb62(idle since 07:56Z); its cleanup-ack commit andremote_attemptentity are kept.remote_attemptsrow acquired from the live task before any remote session opens. The partial unique index keeps one unresolved attempt per dataset.job/update/claim.sqlrefuses to dispatch any job for a dataset (or an org-level job for its org) while one is unresolved, so a retry, a new run and an embedded run (backend switch) are all held at the database.POST /v1/internal/attempts/{a}/remote(acquire / session / request / release). Scope comes from the authenticated task, never the body.RemoteSessionjournals each request id (and flags COMMIT) before sending it; if the journal is refused, the SQL is not sent. Only identifiers and bounded phases are stored.lake.set_commit_message(..., extra_info => {"remote_attempt": id})before COMMIT, so the receipt is atomic with publication. Probed on DuckDB 1.5.4 (DuckFleet) and 2.0.0 (ER): committed → present, rolled back → absent.er-duckfleet. Inputs: receipt, last and commit request state from durableGET /v1/requests/{id}, grace elapsed, pod still live. Outputs: committed / rolled_back / not_executed / unresolved. Nothing is replayed, ever.unknown, and the dispatcher sweep reconciles it once the task is no longer live, using the pinned binding generation (draining allowed, revoked or replaced refuses). An undecidable outcome stays fenced.ducklake-lakehouse/references/duckfleet-recovery.md.Discoveries
(dataset_id, task_instance_id, launch)permits one remote attempt per launch, so a relaunched pod can never inherit an earlier session. Kept on purpose.DELETEroute state is in memory, so after a gateway restart a close cannot be acknowledged. Recovery therefore relies on durablerequestsrecords plus the lake receipt, not on close.Drainingbindings did not load credentials, which would have stopped recovery exactly when draining. They now load optionally, for recovery reads only; admission still requiresActive.DATASET_SCOPEDinfixups.rs, or the aged-store replay refuses them as breaking.Measurements
Gates on
ec86a4e9:make checkexit 0,make check-e2eexit 0 (local Postgres).make check-duckfleet-taskat upstreamac894b5:fault_outcomescommitted/1 receipt and rolled_back/0, recorded induckfleet-task-evidence.json.Measurements
Files