GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||
GeezerVison is showing github.com — Ignore host xattrs for local filesync import identity by sipsma · Pull Request #13389 · dagger/dagger Conversation
|
| Run | Wall | filesync | copy | layercopy |
|---|---|---|---|---|
| cold | 63.84s |
1m3s |
17.7s |
16.9s |
| warm1 | 8.13s |
7.5s |
0.2s |
none |
| warm2 | 7.79s |
7.3s |
0.2s |
none |
Engine logs confirmed warm1 and warm2 reused the same copied ref.
This intentionally treats host xattrs as outside the local import content contract. That avoids making cache identity depend on OS-specific metadata that cannot round-trip consistently through the Linux engine mirror and final refs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
d5cd0c4 to
c33bc65
Compare
A macOS/Colima repro with a Maven-like cache showed a surprising pattern: the first warm import of an unchanged host directory still performed a full copy, while the second warm import reused the copied ref. The instrumentation showed that copy itself was layercopy work, and that the first warm run missed reuse because the computed content hash changed after the cold run. The root cause is that local import identity included host xattrs that are not actually part of the Linux mirror/ref state. On cold add/modify paths filesync hashed the remote client stat, which can include macOS xattrs such as com.apple.provenance. The mirror then tried to write those xattrs best-effort, but Linux rejects non-user namespace names. On the warm unchanged path, directory digests were recomputed from the mirror stat, where those xattrs were absent, so the same host directory produced a different content hash and forced a new layercopy. Make the local import contract explicit: host xattrs are not source identity. Normalize local import stats by dropping xattrs at the client boundary, remove xattrs from filesync stat hashing, stop applying source xattrs to the mirror, and disable xattr copying from the mirror into the final immutable ref so the private mirror content-hash xattr does not leak. Version the private file-content hash xattr to user.daggerContentHash.v2 and lazily repair missing v2 values by hashing the mirror file. Also add targeted OTel spans and layercopy counters around contenthash search/checksum, filesync copy/ref handling, and layercopy traversal/copy work. Those spans split the prior opaque copy section into checksum, search, ref reuse, layercopy, commit, metadata, and copy-stat subparts. Validated with: go test ./engine/client ./engine/filesync ./engine/contenthash ./util/layercopy; git diff --check; rebuilt the dev engine with ./hack/dev true; pruned both stable and dev engine local caches; reran the Colima repro. Before the fix warm1 did a full copy (~32s copy/layercopy). After the fix cold copied once, warm1 reused the copy ref with copy ~0.2s/filesync ~7.5s, and warm2 matched warm1. Signed-off-by: Erik Sipsma <[email protected]>
Remove the temporary OTel spans and copy/contenthash counters that were added to diagnose the local filesync copy path. The first commit still contains the production fix: local import identity no longer depends on host xattrs that cannot round-trip through the Linux engine mirror, and the final ref copy disables mirror-private xattrs. Signed-off-by: Erik Sipsma <[email protected]>
c33bc65 to
357e379
Compare
There was an error while loading. Please reload this page.
* fix(filesync): ignore host xattrs for local import identity A macOS/Colima repro with a Maven-like cache showed a surprising pattern: the first warm import of an unchanged host directory still performed a full copy, while the second warm import reused the copied ref. The instrumentation showed that copy itself was layercopy work, and that the first warm run missed reuse because the computed content hash changed after the cold run. The root cause is that local import identity included host xattrs that are not actually part of the Linux mirror/ref state. On cold add/modify paths filesync hashed the remote client stat, which can include macOS xattrs such as com.apple.provenance. The mirror then tried to write those xattrs best-effort, but Linux rejects non-user namespace names. On the warm unchanged path, directory digests were recomputed from the mirror stat, where those xattrs were absent, so the same host directory produced a different content hash and forced a new layercopy. Make the local import contract explicit: host xattrs are not source identity. Normalize local import stats by dropping xattrs at the client boundary, remove xattrs from filesync stat hashing, stop applying source xattrs to the mirror, and disable xattr copying from the mirror into the final immutable ref so the private mirror content-hash xattr does not leak. Version the private file-content hash xattr to user.daggerContentHash.v2 and lazily repair missing v2 values by hashing the mirror file. Also add targeted OTel spans and layercopy counters around contenthash search/checksum, filesync copy/ref handling, and layercopy traversal/copy work. Those spans split the prior opaque copy section into checksum, search, ref reuse, layercopy, commit, metadata, and copy-stat subparts. Validated with: go test ./engine/client ./engine/filesync ./engine/contenthash ./util/layercopy; git diff --check; rebuilt the dev engine with ./hack/dev true; pruned both stable and dev engine local caches; reran the Colima repro. Before the fix warm1 did a full copy (~32s copy/layercopy). After the fix cold copied once, warm1 reused the copy ref with copy ~0.2s/filesync ~7.5s, and warm2 matched warm1. Signed-off-by: Erik Sipsma <[email protected]> * chore(filesync): remove debug copy tracing Remove the temporary OTel spans and copy/contenthash counters that were added to diagnose the local filesync copy path. The first commit still contains the production fix: local import identity no longer depends on host xattrs that cannot round-trip through the Linux engine mirror, and the final ref copy disables mirror-private xattrs. Signed-off-by: Erik Sipsma <[email protected]> --------- Signed-off-by: Erik Sipsma <[email protected]>
dagger 0.21.5 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## v0.21.5 - 2026-06-10 ### Added - Added expand option to container.exists by @alexcb in dagger/dagger#13310 - Support both Dang v1 and v2, routed by module engineVersion by @vito in dagger/dagger#13388 ### Changed - Prune local cache during disk pressure by @sipsma in dagger/dagger#13375 - Persist trivial core objects by @sipsma in dagger/dagger#13387 ### Fixed - Correct namespaced type-name mangling and cross-dependency interface dispatch in Dang by @vito in dagger/dagger#13377 - Surface exec errors correctly on the Bun runtime in the TypeScript SDK by @marcosnils in dagger/dagger#13395 - Ignore host xattrs for local filesync import identity by @sipsma in dagger/dagger#13389 - Don't shallow-clone the user's repo for git telemetry labels by @marcosnils in dagger/dagger#13363 - Preserve pending lazy container parents by @sipsma in dagger/dagger#13365 - Preserve withChanges parent layers by @dagger-codex[bot] + @shykes in dagger/dagger#13342 - Treat incomplete image metadata as cache miss by @sipsma in dagger/dagger#13346 - Cache registry image metadata by @dagger-codex[bot] + @shykes in dagger/dagger#13341 - Don't require id field for interface conformance in Dang by @vito in dagger/dagger#13318 - Use module-local check names for scale-out by @dagger-codex[bot] + @tiborvass in dagger/dagger#13329 - Fix snapshot owner lease attach/remove race by @sipsma in dagger/dagger#13321 - Follow source symlinks when copying directory contents in layercopy by @marcosnils in dagger/dagger#13326 ### What to do next? - Read the [documentation](https://docs.dagger.io) - Join our [Discord server](https://discord.gg/dagger-io) - Follow us on [Twitter](https://twitter.com/dagger_io) </pre> <p>View the full release notes at <a href="https://github.com/dagger/dagger/releases/tag/v0.21.5">https://github.com/dagger/dagger/releases/tag/v0.21.5</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!11205
…digest (#15168) * filesync: keep a symlink's permission bits out of a host directory's digest A symlink has permission bits of its own on macOS, taken from the umask it was created under. On Linux a symlink is always 0777. The client sent the host's bits, the engine hashed them, and the mirror's link was 0777 either way, since Linux has no bits to set on it. So one tree had one digest from a macOS client and another from a Linux client: $ ln -s notes.md tree/latest.md # macOS, umask 022: lrwxr-xr-x $ dagger -m core api call host directory --path tree digest sha256:523803c6... # the same tree from a Linux client, or with the link made under umask 000 sha256:e1ee8b8a... This is the case #13389 fixed for host xattrs: metadata that cannot round-trip through the Linux mirror is not source identity. Send 0777 for a symlink from the client, next to the uid, gid and xattrs it already normalizes. Hash a symlink as 0777 in the engine too, so a client older than this change gets the same digest: the engine accepts clients back to v0.19.0. A file's and a directory's bits are still sent and hashed. A macOS client's digest of a tree with symlinks changes once. A Linux client's does not. Fixes #15167 Signed-off-by: Dan Shaw <[email protected]> * changie: add the pull request number Signed-off-by: Dan Shaw <[email protected]> * changie: use the entry written by changie new Signed-off-by: Dan Shaw <[email protected]> --------- Signed-off-by: Dan Shaw <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.