Skip to content

cas: repair corrupt blobs on verified reupload - #57

Draft
fionera wants to merge 1 commit into
hermeticbuild:mainfrom
fionera:fionera/repair-corrupt-cas
Draft

fionera wants to merge 1 commit into
hermeticbuild:mainfrom
fionera:fionera/repair-corrupt-cas

Conversation

@fionera

@fionera fionera commented Nov 2, 2026

Copy link
Copy Markdown

A verified reupload currently cannot repair an existing truncated CAS blob. A same-size zero-filled blob also passes the size-only check, leaving the cache unusable even when the client sends the correct contents again.

Hash existing blobs on upload/promotion collisions and atomically replace invalid contents with the verified incoming inode. Keep Store.has as the inexpensive size check; this does not add a full-file hash to every cache lookup. Symlink/non-file collisions remain errors.

The regression cases cover truncated and same-size corruption through anonymous uploads, the named-file fallback, and same-filesystem promotion. They run in the existing //src:unit_tests target; no additional CAS-only test target is needed.

Validation was performed with these fixes combined in a Linux KVM integration workspace, using actiond for execution and caching. The native unit suite, filesystem probes, and a large mixed-language Bazel workload passed. These draft changes have not been validated with tools/e2e.sh vm on macOS.

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