Skip to content

Keep microsandbox checkpoints as native snapshots - #816

Merged
SaladDay merged 1 commit into
mainfrom
keep-microsandbox-checkpoints-as-native-snapshots
Oct 21, 2026
Merged

SaladDay merged 1 commit into
mainfrom
keep-microsandbox-checkpoints-as-native-snapshots

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #815.

A microsandbox suspend exported the native snapshot to a zstd archive, fsynced and hashed it, then deleted the native snapshot; every resume hashed and unpacked the archive again. On mx that export was 2.73 s of a 5.85 s suspend and about 0.9 s of each resume.

Now the native snapshot is the checkpoint:

  • Suspend creates the full snapshot directly in the private checkpoint root (SnapshotCreateOptions.DestDir, group s-<operation>). The SDK materializes the checkpoint closure there (hard links on the same filesystem, otherwise a synced copy) and returns it durable. The adapter verifies it once, writes the ownership receipt, stops the source, then reports SourceStopped.
  • Resume verifies the snapshot once and restores from it directly. A node that mounts the same checkpoint root restores it the same way, so checkpoint transfer keeps working.
  • DeleteSnapshot writes the tombstone, then removes everything else in the operation directory without opening the snapshot, so a damaged snapshot or an interrupted capture's staging directory never blocks cleanup.
  • Archive export, import, hashing and their receipt fields are deleted.

Cost: a retained checkpoint takes about 0.5 GB instead of about 0.15 GB, and a shared checkpoint root receives a full copy at suspend.

Checks: helper tests with the bundled SDK (scripts/build-microsandbox-provider.py test), go test for internal/sandbox/microsandbox, Core go vet ./internal/sandbox/..., translation check. Real-cluster timings on mx are in progress.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@blacksmith-sh

This comment has been minimized.

@SaladDay
SaladDay force-pushed the require-workspace-storage-for-microsandbox branch from 936397f to 9fae750 Compare October 21, 2026 20:57
@SaladDay
SaladDay force-pushed the keep-microsandbox-checkpoints-as-native-snapshots branch from 9fdfcff to 1413892 Compare October 21, 2026 20:57
Base automatically changed from require-workspace-storage-for-microsandbox to main October 21, 2026 21:04
@SaladDay
SaladDay force-pushed the keep-microsandbox-checkpoints-as-native-snapshots branch from 1413892 to 2bfafe7 Compare October 21, 2026 21:04
@SaladDay
SaladDay merged commit 5036ed8 into main Oct 21, 2026
19 checks passed
@SaladDay
SaladDay deleted the keep-microsandbox-checkpoints-as-native-snapshots branch October 21, 2026 21:09
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.

1 participant