Repository navigation
feat(sync): fetch the records of changes, and snapshots as they're read - #128
Open
PiquelChips wants to merge 1 commit into
Open
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit details
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. |
PiquelChips
force-pushed
the
feat/sync-fetch-changes
branch
from
November 22, 2026 15:04
015feb0 to
5260d94
Compare
PiquelChips
force-pushed
the
feat/sync-fetch-changes
branch
2 times, most recently
from
November 22, 2026 18:54
8b5a14f to
90fe00d
Compare
`Sync` shares records with a remote. This is its fetching side for changes: `fetch_changes` asks the remote what it holds of some changes, by id, and fetches the records this node lacks, with those they refer to, recursively (a revision's base and dependencies, a statement's subject and the statements it supersedes or promotes), then the records of the changes the revisions fetched belong to, so every change this node learns of comes whole. It flags the changes that diverged. Answers that stop short are asked for again from where they stopped. Snapshots don't come with records: `Sync::need` fetches one when something reads it, skipping what snapshots this node holds whole hold at the same path. A fetch publishes trees before what they hold, so a snapshot being fetched is marked durably in `fetching/`, synced with the batch, and `Store::holds` doesn't take a marked one for whole: fetching it again completes it. `Sync::repair` fetches a snapshot whole again, for one that lacks trees its root names. `Dependencies` now tells the records an object refers to from its content, since only records come with a fetch.
PiquelChips
force-pushed
the
feat/sync-fetch-changes
branch
from
November 22, 2026 19:20
90fe00d to
722b874
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.
The first half of fetching: bringing the records of changes, and the snapshots a command reads.
Records of changes:
Sync::fetch_changesasks the remote what it holds of some changes, by id, and fetches the records this node lacks, with those they refer to, recursively.Snapshot transfers:
Sync::needfetches one when something reads it, skipping what the snapshots this node holds whole hold at the same path.fetching/, synced with the batch, andStore::holdsnever takes a marked one for whole.Sync::repairfetches a snapshot whole again.Benchmarks (20k files over local HTTP, measured by the sync benchmark later in this stack): fetching the snapshot a clone needs takes about 490 ms, and a snapshot with 100 edits 22 ms.
Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)