Skip to content

fix(store): publish a push's trees after the trees they hold - #167

Open
PiquelChips wants to merge 1 commit into
chore/swarm-skillfrom
fix/publish-a-push-s-trees-after
Open

PiquelChips wants to merge 1 commit into
chore/swarm-skillfrom
fix/publish-a-push-s-trees-after

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

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)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 028cb710-803b-4b56-a0ea-d8d159889c09

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@PiquelChips
PiquelChips changed the base branch from chore/swarm-skill to main November 22, 2026 20:21
@PiquelChips
PiquelChips added this pull request to stack #185 November 22, 2026 20:21
@PiquelChips
PiquelChips removed this pull request from stack #185 November 22, 2026 20:22
@PiquelChips
PiquelChips changed the base branch from main to chore/swarm-skill November 22, 2026 20:22
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
PiquelChips force-pushed the fix/publish-a-push-s-trees-after branch from 8c4e055 to 32ce0b8 Compare November 22, 2026 20:22
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