Skip to content

volumes: attach-only claims leave mounting to the workload - #80

Merged
CMGS merged 3 commits into
mainfrom
feat/lazy-volume-mount
Aug 13, 2026
Merged

volumes: attach-only claims leave mounting to the workload#80
CMGS merged 3 commits into
mainfrom
feat/lazy-volume-mount

Conversation

@CMGS

@CMGS CMGS commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Stacked on #77 (the concurrent bring-up); only 369203c is this PR.

A claim may now set volumes_attach_only: sandboxd attaches the catalog
disks and stops — no sysfs settle, no mkdir, no guest mount. The workload
discovers each device by its virtio serial (/sys/block/*/serial carries
the attach name) and mounts, umounts, and owns filesystem consistency
itself. The whole delivery contract stays synchronous: attach failures
fail the claim exactly like today, and there is no pending state, no
readiness barrier, and no async failure surface.

What the sandbox keeps is exactly what protects OTHER claims: the
admission registry (a live attach-only rw writer still refuses readers
and second writers with 409s) and the hypervisor lock belt. What it
deliberately drops for attach-only entries is the consistency machinery
it could not honestly operate: dirty markers are neither written nor
cleared (the sandbox cannot verify the caller's umount, so a marker could
never be cleared truthfully), and teardown does nothing guest-side — VM
removal closes the devices. Releasing without a clean self-umount equals
a filesystem crash for that image: the next eager ro claim fails loudly
at mount time (500) instead of the marker's 409, and any rw cycle
recovers it. All documented, including the raw-block-device caveat.

Internal shape: validation skips mount defaulting under the flag, so the
applied and persisted entries carry an empty mount — that absence is the
one signal the pool branches on (apply: attach only; quiesce: skip). No
manager interface changes, no new persisted fields; a non-wire
json:"-" bool carries the flag between the server's validation and the
pool's defensive re-validation, and is cleared before entries are
applied (the double-validation would otherwise re-default the mounts).

Surfaces: Go WithVolumesAttachOnly(); Python mount=False on both
claim entry points (default mount=True — eager semantics are completely
unchanged, pinned byte-for-byte: eager replies carry the mount key and no
new keys; attach-only entries echo without a mount key and the flag never
leaks into replies). Engine-op pins: an attach-only rw claim records
attach and remove only — zero mount/umount/sync — and no .dirty file
ever appears.

Gates: build + -race across sandboxd (13 pkgs), sdk/go, e2e
(GOWORK=off); ruff clean, pytest 151 (+4); dual-GOOS golangci-lint and
asl zero findings; gofmt/gofumpt clean. Hot path: volume-less and eager
claims pay one boolean test in validation, nothing else.

Base automatically changed from feat/parallel-volume-attach to main August 13, 2026 10:44
CMGS added 2 commits August 13, 2026 18:46
volumes_attach_only skips the guest mount entirely: sandboxd attaches
the disks and the caller discovers them by virtio serial and mounts,
umounts, and owns consistency itself. Admission exclusion is unchanged
— it protects other claims. Attach-only rw neither writes nor clears
dirty markers: the sandbox cannot verify the caller's umount, so it
makes no promise it cannot keep.
@CMGS
CMGS force-pushed the feat/lazy-volume-mount branch from 369203c to 2b7d4ee Compare August 13, 2026 10:46
finalizeBatch's quota arm still released admission holds before the VM
was confirmed removed — the ordering the retain-holds commit fixed at
the two apply-failure sites, and wider here since the volumes are fully
mounted when the finalize re-check loses the quota race. One helper now
owns the hand-off and the nil-out that keeps the deferred unreserve from
double-releasing.
@CMGS
CMGS merged commit ca75e9f into main Aug 13, 2026
2 checks passed
@CMGS
CMGS deleted the feat/lazy-volume-mount branch August 13, 2026 12:10
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