Repository navigation
Keep live zero-byte objects during input pack collection - #686
Draft
ConnorBaker wants to merge 1 commit into
Draft
ConnorBaker wants to merge 1 commit into
ConnorBaker wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A local hash-pinned tarball containing one empty regular file exposed a mismatch on
0bf30820d. Before collection, an ordinaryiets evalofbuiltins.hashFile "sha256" (input + "/empty")and a fresh--no-tracing-cacheevaluation both returned SHA-256(empty). Afteriets cache gc --ttl 30, the warm command returned the same hash while the fresh process failed with “an object of this input is missing from the input store”. Both live tree indices survived. On a fresh input store the automatic sweep after the first fetch can also trigger this failure.The collector summed live payload bytes to decide whether a pack held any live object. A zero-byte object contributes zero to that sum. Keep track of object membership separately and continue using payload sizes to decide when a partially live pack is worth compacting.
A previous sweep can have removed the final copy of the empty object. Collection can reconstruct it when a live index names the precise BLAKE3 ID of empty bytes and a complete, well-formed pack listing establishes its absence. Dry runs, incomplete listings, and listings with a malformed pack skip recovery. All ordinary read paths, including operational errors reported by #643, retain their existing behavior.
The tests cover a mixed pack whose only survivor is empty, the resulting all-live zero-byte pack, recovery with an unrelated missing ID, and public warm and fresh evaluations across GC. Independent process checks exercised real permission denial, an injected EIO during pack index reads, a malformed pack and recovery of a store produced by the old binary. The fix acts during collection, with no added work on a normal trace hit.
AI assistance: OpenAI Codex.
On the fix, fresh native and warm evaluation both returned the empty-file digest before and after the same managed collection. The input-store and pack unit suites passed 28 tests. The public fetchurl and cache hygiene suites passed all 16 tests.