Skip to content

atelet: prune local pause snapshots - #705

Merged
Dmitry Berkovich (dberkov) merged 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:issue-668-local-snapshot-gc
Aug 7, 2026
Merged

atelet: prune local pause snapshots#705
Dmitry Berkovich (dberkov) merged 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:issue-668-local-snapshot-gc

Conversation

@orangeCatDeveloper

@orangeCatDeveloper NekoPunch (orangeCatDeveloper) commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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. Checkpoint now prunes every existing snapshot before writing the new one — each is superseded by the snapshot about to be written, and pruning first caps disk usage at a single snapshot. 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 silently write nested directories, and .. could escape the actor's directory entirely.

Fixes #668

Test plan

  • Unit: prune remove-all/missing-dir cases; validator table (nested, traversal, absolute, backslash); Checkpoint + Restore request rejection cases
  • Live on kind: demo e2e suites pass (snapshot + durable-dir lifecycle: pause→resume→suspend→resume across pause-scope configs); atelet logs confirm each checkpoint prunes the prior snapshot before the write

Comment thread cmd/atelet/main.go Outdated
Comment thread cmd/atelet/main.go

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comment, otherwise LGTM

Pause snapshots accumulated until the node disk filled; the control
plane only ever references the latest one. Checkpoint now removes every
existing snapshot before writing the new one, capping disk use at a
single snapshot.

Snapshot prefixes are validated as single path segments at the RPC
boundary: a nested or relative prefix would nest on write or escape the
actor's directory entirely.
@dberkov
Dmitry Berkovich (dberkov) merged commit a44545e into agent-substrate:main Aug 7, 2026
11 checks passed
@orangeCatDeveloper
NekoPunch (orangeCatDeveloper) deleted the issue-668-local-snapshot-gc branch August 7, 2026 05:56
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

2 participants