Repository navigation
ResumeActor can require an expected snapshot - #2957
Tom Gamble (gambtho) wants to merge 8 commits into
Conversation
Anish Ramasekar (aramase)
left a comment
There was a problem hiding this comment.
The check holds up for a SUSPENDED actor: validation runs under the lease, every later write is a CAS on the validated version, and in-flight transitions come back ABORTED. Two retry semantics look off, both confirmed with probes: a retry of a conditioned resume that already succeeded gets FAILED_PRECONDITION, and a concurrent template repoint gets FAILED_PRECONDITION although the same request succeeds when retried. Details inline, plus a few nits.
Two things sessions will need to handle (not blockers): after the default async suspend, a conditioned resume returns UNAVAILABLE until the upload completes; and a local-first actor with an older local copy can't satisfy expected.
Also, AGENTS.md asks for a rebase onto main rather than merging main into the branch.
7d36477 to
f83d533
Compare
55149a4 to
3a6970d
Compare
|
Rebased onto #2967; |
f3b431d to
e73054d
Compare
4ec7a6d to
a180bf0
Compare
| } | ||
| switch latest.GetDurableSnapshot().GetStatus() { | ||
| case ateapi.SnapshotStorageStatus_SNAPSHOT_STORAGE_STATUS_PENDING: | ||
| return apierror.Unavailable("expected snapshot is not yet complete in durable storage") |
There was a problem hiding this comment.
If the actor's node was deleted before atelet reported this upload, nothing will mark it COMPLETED, so a conditioned resume returns UNAVAILABLE on every retry while an unconditioned one restores it via #3094. Could this path check NodeGone and either follow the gone-node restore or return FAILED_PRECONDITION so callers stop retrying?
There was a problem hiding this comment.
Fixed in 0cc025f: conditioned resumes restore the matching upload after its node is deleted, or return FAILED_PRECONDITION with the held and expected snapshot identities if the upload is missing.
a180bf0 to
dfa7f1b
Compare
0cc025f to
1b4e89e
Compare
Let callers bind resume to an actor incarnation and snapshot generation. Validate the condition under the lifecycle lease before restore work, and recheck it after assignment conflicts. Requests without a condition retain the existing behavior. Signed-off-by: gambtho <Thomas.Gamble@microsoft.com>
Signed-off-by: gambtho <Thomas.Gamble@microsoft.com>
Signed-off-by: gambtho <Thomas.Gamble@microsoft.com>
Signed-off-by: gambtho <Thomas.Gamble@microsoft.com>
Signed-off-by: gambtho <Thomas.Gamble@microsoft.com>
Signed-off-by: gambtho <Thomas.Gamble@microsoft.com>
Signed-off-by: gambtho <Thomas.Gamble@microsoft.com>
Signed-off-by: gambtho <Thomas.Gamble@microsoft.com>
1b4e89e to
7efdb04
Compare
Sessions needs resume to refuse a checkpoint that changed after its GetActor check.
Adds optional
ResumeActorRequest.expected(actor_uid,snapshot_uuid,generation). Stale actor/checkpoint returnsFAILED_PRECONDITION; a matching pending upload returnsUNAVAILABLE. Matching RUNNING retries returnresumed=false. Concurrent template changes returnABORTED.Without
expected, behavior is unchanged. This does not select older snapshots or enforce restore fidelity. New clients must wait until every API server supports the field.Local race tests, verifiers and fake-atelet tests passed. Runtime E2E and root-only tests weren't run locally.
Fixes #2832. Related: agent-primitives/sessions#192.