ateapi: resolve the resume boot source and wire scope once in loadActorForResume - #1492
Open
Zoe Zhao (zoez7) wants to merge 1 commit into
Open
ateapi: resolve the resume boot source and wire scope once in loadActorForResume#1492Zoe Zhao (zoez7) wants to merge 1 commit into
Zoe Zhao (zoez7) wants to merge 1 commit into
Conversation
Zoe Zhao (zoez7)
force-pushed
the
resume-refactor
branch
from
September 4, 2026 21:30
a98f590 to
429a5f3
Compare
Zoe Zhao (zoez7)
marked this pull request as ready for review
September 4, 2026 21:33
Zoe Zhao (zoez7)
force-pushed
the
resume-refactor
branch
from
September 4, 2026 21:39
429a5f3 to
8b36b58
Compare
Zoe Zhao (zoez7)
force-pushed
the
resume-refactor
branch
3 times, most recently
from
September 4, 2026 23:36
5a9e4e7 to
b23df34
Compare
Zoe Zhao (zoez7)
force-pushed
the
resume-refactor
branch
3 times, most recently
from
September 5, 2026 20:09
e23cedf to
330a02c
Compare
The resume path decided the boot source in two places that agreed only by hand-mirrored ordering. loadActorForResume picked a snapshot URI (the actor's own, else the template's golden), a content scope, and a template-replaced flag; ensureAteletRestored then re-derived the rest in every branch: local-vs-durable from LocalSnapshotInfo, cold boot from an empty SnapshotURI, the telemetry snapshot kind from the actor's external snapshot record, and the wire scope from a three-case switch repeated per branch. Resolve everything in loadActorForResume as a first-match rule list: updated template, paused actor, own durable snapshot, then golden fallback or cold boot (with an explicit boot request skipping only the golden fallback, as before). resumeSnapshotSource now carries the resolved restoreKind and wire scope; ensureAteletRestored dispatches on the kind, maps the telemetry labels from it, and fails with Internal on an unhandled kind instead of silently cold booting. The golden snapshot's validation and URI parsing, previously duplicated between the no-snapshot fallback and the Golden data-resume policy, collapse into resolveGoldenSnapshot; the per-branch scope fallbacks fold into resolveRestoreScope. A paused actor's restore scope now comes from pausedContentScope — the scope recorded on the checkpoint, with the template's onPause standing in for legacy checkpoints — the same derivation suspend uses. GoldenSnapshotURI becomes GoldenForDataSnapshotURI, since it only ever names the guest half of a data-only combined restore, never the boot snapshot itself. A golden boot now gets its own log line (it used to log as a durable-snapshot restore) and an explicitly FULL wire scope (it used to echo the golden's recorded content scope). Four behavior changes ride along, all on paths where the old code resolved or demanded state the restore would not use: - An actor whose ActorTemplate was updated restores its data alone, but the old resolution still consulted the Golden resume policy for its Data-scoped capture and failed with FailedPrecondition (or DataLoss) when the template recorded no valid golden. Rule 1 now returns before the policy is consulted. - The template update was only detected when the actor held a durable snapshot. An actor resuming from a local pause checkpoint alone restored at the template's onPause scope, carrying guest state built on the previous template; it now gets the same data-only restore as every other actor whose template was updated. - The golden fallback is only resolved for an actor with no snapshot of its own. A paused actor without a durable snapshot used to run the fallback resolution anyway — its local checkpoint restore ignored the result, but a legacy-scoped or unparseable golden failed the resume. - A paused actor's shadowed durable snapshot URI was parsed even though the local restore never consumes it, so an unparseable URI failed the resume with DataLoss. The URI is now parsed exactly when the durable snapshot is the boot source. Tests pin the rule list: the updated-template bypass of the Golden policy, boot skipping only the golden fallback, the golden fallback's FULL scope, the recorded pause scope outranking the template's onPause, DataLoss on an unparseable durable snapshot URI only when it is the boot source, and the kind-to-telemetry mapping.
Zoe Zhao (zoez7)
force-pushed
the
resume-refactor
branch
from
September 5, 2026 20:29
330a02c to
6c45f08
Compare
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.
Refactored
loadActorForResumeto resolve the boot source and wire scope once, in 4 rules:The restore step now dispatches on the resolved kind and fails with Internal on an unhandled kind instead of silently cold booting.
Behavior changes
A resume after an ActorTemplate update now restores data-only from the existing snapshot or checkpoint — including a Paused actor holding only a local checkpoint — and no longer consults the Golden policy, so an absent or invalid golden no longer fails it with FailedPrecondition. This is a temporary placeholder until [Based on 1492] Resume with Golden+DurDir when ActorTemplate updated. #1461 switches this path to golden+data.
A Paused resume no longer validates inputs the local restore never consumes: an unusable golden no longer fails it (intentional bugfix), and the shadowed durable
ExternalSnapshot.SnapshotUriis no longer parsed, so an unparseable record no longer fails it with DataLoss.Tests pass
Appropriate changes to documentation are included in the PR - Not required