Skip to content

atelet: prune local pause snapshots - #705

Open
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:issue-668-local-snapshot-gc
Open

atelet: prune local pause snapshots#705
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:issue-668-local-snapshot-gc

Conversation

@orangeCatDeveloper

Copy link
Copy Markdown

Summary

atelet never deletes local pause snapshots, so they accumulate until the node disk fills (#668). The control plane only ever references the latest one (LocalSnapshotInfo is single-valued), so older directories are dead weight by design. Pause now prunes everything except the snapshot it just wrote; suspend removes them all, since the durable snapshot supersedes local state. Pruning is best-effort: a failed delete is logged and retried by the next prune, never failing the checkpoint.

Snapshot prefixes are now validated as single path segments at the Checkpoint/Restore RPC boundary (shared ValidateLocalSnapshotPrefix). Previously only checked non-empty: a nested prefix like pause/2 would write nested but be pruned as its top-level directory, deleting the fresh snapshot; .. could escape the actor's directory entirely.

Fixes #668

Test plan

  • Unit: prune keep/remove-all/missing-dir cases; validator table (nested, traversal, absolute, backslash); Checkpoint + Restore request rejection cases
  • Live on kind: pause×2 leaves exactly one snapshot directory (the newest, verified by timestamp); suspend removes the directory; actor resumes to RUNNING afterwards

Pause snapshots accumulated until the node disk filled; the control
plane only ever references the latest one. Pause now keeps just the
snapshot it wrote, suspend removes them all.

Snapshot prefixes are validated as single path segments at the RPC
boundary: a nested prefix would nest on write but be pruned as its
top-level directory, deleting the fresh snapshot.
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.

Pause snapshots are not cleaned up

1 participant