Repository navigation
fix(store): publish a push's trees after the trees they hold - #167
Open
PiquelChips wants to merge 1 commit into
Open
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
A push wrote its blobs and trees in one batch, renamed into place in parallel, so a crash or a failed rename could publish a tree without a subtree. Later pushes check only that a tree they need is stored, so they would build on the incomplete one. A durable write now stages files in layers, publishing each once the layers before it are durable, still with one batch sync, and a push writes blobs and attachments first, then each tree after the trees it holds.
PiquelChips
force-pushed
the
fix/publish-a-push-s-trees-after
branch
from
November 22, 2026 20:22
8c4e055 to
32ce0b8
Compare
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 push wrote all of a pack's blobs, trees and attachments in one batch, whose files are renamed into place in parallel. A crash before the directories were synced, or a rename that failed, could leave a tree in the store without one of its subtrees. Later pushes only check that a tree they need is stored, so they would build revisions on the incomplete tree.
A durable write can now stage files in layers: it still syncs the whole batch once, then renames each layer's files and syncs their directories before it touches the next layer. A push puts blobs and attachments in the first layer and each tree one layer after the highest subtree the pack holds, so a tree is only ever published once everything it holds is durable. If a rename fails, no later layer is published.
push_100_edited(just bench, sample count 10, on a loaded machine, so the medians are mostly noise): fastest 295.5 ms before, 310.7 ms after; median 1.003 s before, 621.8 ms after. A push of 100 edited files now syncs a few more directories, one round per tree level.Part of #166.
Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)