You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: A checkpoint that stores an actor without suspending it #3299
A way to store a durable snapshot of an actor while it keeps running: a checkpoint that doesn't suspend it, uploaded to object storage the way a suspend's snapshot is.
Why
We run Substrate v0.6.0 on GKE as the sandbox for agent sessions: each session is an actor, suspended when it goes idle and resumed at the next message. Today an actor's state is stored only by suspending it (SuspendActor, with DurabilityMode synchronous or asynchronous). DrainWorker deliberately leaves bound actors alone, so draining a node stores nothing.
So an actor that stays busy is never stored. An agent turn can run for 40 minutes, or a user can send messages a minute apart for an hour. If GKE replaces the node during that stretch (a routine node upgrade replaces every node in turn), the actor goes back to its last suspend, and everything since is lost.
Suspending the actor between requests isn't a substitute:
suspending and resuming a chatty actor every few minutes charges each of those messages a resume.
What it would look like
Something like a CheckpointActor (or a SuspendActor option that resumes the actor once the snapshot is captured on the node), whose snapshot then uploads in the background and becomes the actor's latest durable one. A client could then store a busy actor on a schedule, or between turns, and bound what a node replacement costs.
Related: #2470 (resuming an actor whose node is gone), which is the other half of surviving a node replacement.
Activity