Use snapshots as fanout parents#232
Conversation
✱ Stainless preview builds for hypemanThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs. ✅ hypeman-openapi studio · code · diff
✅ hypeman-typescript studio · code · diff
✅ hypeman-go studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: PR modifies snapshot and fork lifecycle logic in packages/api/lib/ but does not appear to change API endpoints (packages/api/cmd/api/) or Temporal workflows (packages/api/lib/temporal) that the filter specifically targets. To monitor this PR anyway, reply with |
1036a80 to
05e4a11
Compare
Summary
ref_counton snapshot API responsesTests
Note
Medium Risk
Changes snapshot lifecycle semantics and the public API schema (new required
ref_countand409on delete), which may affect clients and cleanup behavior. Forking now hardlinks snapshot memory files, so filesystem/linking edge cases could impact fork reliability.Overview
Snapshots now act as fanout parents. Instances created via
ForkSnapshotpersist the source snapshot ID in metadata (ForkOfSnapshot), and snapshotGET/LISTresponses expose a new requiredref_countfield.Deletion semantics tighten. Explicit snapshot deletion now fails with
409 Conflictwhen any direct forks still exist (and scheduled cleanup silently skips those snapshots), and the OpenAPI/client code is updated accordingly.Fork performance/space change. Snapshot forks avoid copying the raw memory file by skipping it during directory copy and then hardlinking it into the forked instance; tests add coverage for ref counting, unreadable metadata, and inode sharing.
Reviewed by Cursor Bugbot for commit 05e4a11. Bugbot is set up for automated code reviews on this repo. Configure here.