Skip to content

core: preserve completed container parts across restart - #14050

Merged
sipsma merged 15 commits into
mainfrom
sipsma/remote-cache-container-part-persistence
Sep 19, 2026
Merged

sipsma merged 15 commits into
mainfrom
sipsma/remote-cache-container-part-persistence

Conversation

@sipsma

@sipsma sipsma commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

A completed mounted directory write could be repeated after restart while the container's other parts remained pending. Container persistence now saves completion and values per part. Restored snapshots open individually on demand, so metadata reads and narrow file reads leave unrelated outputs closed.

Saved descriptors retain ordinary snapshot ownership through typed decode, unopened re-persistence, and operation clearing. Pending parts keep their original recipe and group boundaries. Reporting distinguishes saved-value opening from remaining computation. The local persistence format advances to 18; caches from earlier formats reset on startup. Standalone Directory/File dependency decoding remains unchanged.

Depends on #14049 and its per-part evaluation stack. Design and implementation evidence and bounded model results describe the mechanisms and limits.

Validation:

  • All 25 selected TLA+ configurations passed, including 18 quick cases and three new persistence cases. The single-group anchor remains exactly 6,398,997 distinct states. Eleven reachability probes and eleven deliberate breaks exercised the new behavior. The full TLA+ suite was intentionally omitted.
  • Focused core and DagQL race selections passed (1.742s and 1.961s). All 27 selected existing container routing tests also passed under race detection (1.481s); the exact selection is recorded in the design.
  • The two-restart engine test passed, preserving actual mounted snapshot IDs with no repeated writer body or directory commit. It covers typed and untouched-envelope middle runs, fresh selectors, independent exec-output opening, and children of restored parents. The later empty-path initialization refinement passed the codec race test.
  • A private completion-loss mutation failed at the intended middle-engine assertion. This control discards completed outputs from partial rows; it does not reconstruct historical source.
go test -race ./core -run '^Test(Container(Restore|Persisted|ExecSuccessConsumesFinalReadOnlyMount)|RecordStatus)' -count=1 -timeout=5m
go test -race ./dagql -run '^Test(Evaluate(Parts|WholeResultOverGroups)|Lazy(Emit|Triggered)|WcprofLazyParent|Cache(SnapshotOwnerLeaseSyncDefersSessionCleanup|Persistence(Import|WorkerUsesEncodedSnapshotLinks|SchemaMismatch)))' -count=1 -timeout=5m
dagger api call engine-dev test --pkg ./core/integration --run='TestCachePersistence/TestDiskPersistenceAcrossRestart/container_parts_preserve_mutations_and_unopened_snapshots' --test-verbose=true --timeout=15m

No full engine suite or broad lint/generator run was performed. The change adds no public schema fields.

@sipsma
sipsma force-pushed the sipsma/remote-cache-container-part-persistence branch from 81bb910 to 36692fe Compare September 9, 2026 22:09
@sipsma
sipsma requested review from a team as code owners September 9, 2026 23:17
@sipsma
sipsma force-pushed the sipsma/remote-cache-container-part-persistence branch from 36692fe to 9375bbb Compare September 9, 2026 23:26
@sipsma
sipsma force-pushed the sipsma/remote-cache-container-part-persistence branch from 9375bbb to 52ee0e1 Compare September 18, 2026 19:37
@sipsma
sipsma force-pushed the sipsma/remote-cache-container-part-persistence branch from 52ee0e1 to 00eaf56 Compare September 18, 2026 19:56
Base automatically changed from sipsma/remote-cache-track8-terminology to main September 18, 2026 20:55
@sipsma
sipsma force-pushed the sipsma/remote-cache-container-part-persistence branch 3 times, most recently from 60dbab3 to ade30bc Compare September 19, 2026 03:42
Preserve consumed computation through flush and restart. Model saved
snapshot demand separately, including direct metadata scans and retries.
Add bounded scenarios and independent capture and opening assertions.

Signed-off-by: Erik Sipsma <[email protected]>
Check original group seeding and use operational parent finality for body choices. Scope the joint scenario to one caller on each side of restart and record bounded evidence and the completed-only decode contract.

Signed-off-by: Erik Sipsma <[email protected]>
Preserve the checked sweep scenario and record final selected checks, reachability probes, deliberate breaks, and their scope limits.

Signed-off-by: Erik Sipsma <[email protected]>
Encode completed part descriptors beside remaining computation. Restore saved snapshots through independent local opening groups while preserving original recipe latches, ownership links, usage, and reporting purpose.

Include focused codec and restore tests plus an opt-in real restart witness. Focused codec race checks passed on the saved draft; real restart and further reporting and ownership validation remain in progress.

Signed-off-by: Erik Sipsma <[email protected]>
Exercise stored-open bookkeeping retries, cached and partial reporting, cause and wait links, cancellation, session release, shared owner leases, and detached file and directory paths. Install recorded paths unconditionally when opening completed values.

Correct the restart fixture for the generic SDK ID API, require original snapshot identities, and exercise schema children built from a closed restored parent. The focused core race set passes. The real three-engine test passed with the SDK and child checks before the empty-path refinement.

Signed-off-by: Erik Sipsma <[email protected]>
Reconcile the approved design and internal persistence, lazy evaluation, and pruning references with schema18, independent stored opens, and computation reporting. Record immutable bounded model evidence, selected race checks, the actual three-engine witness, and the deliberate completion-loss control with exact source and export limits.

Signed-off-by: Erik Sipsma <[email protected]>
Describe retained completed outputs and snapshot opening on demand.
Record the local cache format reset.

Signed-off-by: Erik Sipsma <[email protected]>
Use consistent receiver names, remove unused metadata context and stale exceptions, and preserve setup calls while checking their meaningful results. Keep completed-part validation together with a local complexity explanation.

Signed-off-by: Erik Sipsma <[email protected]>
Container persistence adds the reporting branch to the shared attempt loop.
It also adds the first container restart scenario to the shared fixture.
Keep each local complexity exception with that change.

Signed-off-by: Erik Sipsma <[email protected]>
The three container persistence configurations did not assign
DelegatedReleaseOnly, which main's client-lifecycle model declares, and
main's orphaned_lease and release_wait configurations did not assign
this branch's ModelContainerPartPersistence. All five now assign the
value every other non-mutating configuration uses (FALSE), inside the
CONSTANTS block.

Signed-off-by: Erik Sipsma <[email protected]>
Fresh dagger generate go-sdk:generate on this branch. Source-map lines
only.

Signed-off-by: Erik Sipsma <[email protected]>
With the lazy attempt's callback body in its own method, evaluateGroup
sits under golangci-lint's gocyclo limit, and nolintlint rejects an
unused directive. The integration fixture's directive still applies.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma force-pushed the sipsma/remote-cache-container-part-persistence branch from ade30bc to b6b328b Compare September 19, 2026 04:52
@sipsma
sipsma merged commit 92c4619 into main Sep 19, 2026
84 of 86 checks passed
@sipsma
sipsma deleted the sipsma/remote-cache-container-part-persistence branch September 19, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants