Skip to content

engine: resolve a missing live mount path without an error; live add timing - #401

Merged
CMGS merged 1 commit into
mainfrom
perf/live-volume-add
Oct 29, 2026
Merged

CMGS merged 1 commit into
mainfrom
perf/live-volume-add

Conversation

@CMGS

@CMGS CMGS commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Two follow-ups from the #398 hardware round.

1. No warning on every live mount. MountLiveVolume checks the target before mkdir, so realpath failed on the not-yet-created path and logged a resolve volume mount warning per attach (11 per round on main). realpath -m resolves missing components lexically and still follows existing symlinks, so the check for an occupied path behind a symlink is unchanged (TestLiveMountRefusesAnOccupiedPathBehindASymlink, TestLiveAttachRejectsForeignMounts pass). The guest call itself stays: skipping it when the device is not mounted lets a live mount land on another device behind a symlink, which those two tests catch.

2. Live volume add timing (test). Instrumented build (not committed) on cocoon-test2, cocoon v0.7.4, rt:24.04, 15 runs each, p50:

step claim-time rw mount live rw add live ro add
dirty marker 0.2 ms 0.0 ms —
cocoon vm disk attach 31.7 ms 31.4 ms (same path)
attach → device visible in guest 70.7 ms
live "already mounted?" check — 13.6 ms
whole apply 174.6 ms 183.9 ms client add 184.7 ms
client SetVolumes total — 183.2 ms 184.7 ms

The live path adds about 14 ms over the claim-time mount (the mountinfo check that makes a retried PUT idempotent). Read-only and writable live adds cost the same. Device appearance (about 70 ms after the attach returns) and mkdir + mount (about 70 ms) dominate on both paths, and that is where any further work belongs; it is the same area as #400. Zero resolve volume mount warnings with this change.

Gates: golangci-lint 0 issues. (sandboxd, linux and darwin), fmt clean, go test -race ./engine/ ./pool/.

Every live mount checks its target before mkdir, so realpath failed on the not-yet-created path and logged a warning per attach (11 per hardware round). realpath -m resolves missing components lexically and still follows existing symlinks, so the occupied-path check behind a symlink is unchanged.
@CMGS
CMGS merged commit f038ed7 into main Oct 29, 2026
1 check passed
@CMGS
CMGS deleted the perf/live-volume-add branch October 29, 2026 09:26
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