Repository navigation
feat(api): fetch snapshots by walking them, in bounded parts - #124
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-snapshot-fetch
branch
from
November 22, 2026 15:04
c447fbc to
7d61612
Compare
PiquelChips
force-pushed
the
feat/sync-snapshot-fetch
branch
2 times, most recently
from
November 22, 2026 18:54
18768dd to
32e7a55
Compare
A clone should only need the snapshots it reads, and a server should be able to decide what each caller may read by path. So trees and blobs no longer leave a repository by id: `POST snapshots/fetch` walks a snapshot from its root and sends the objects none of the caller's snapshots holds at the same path, parents first, optionally only under some paths. `Store::added` does the walk, skipping subtrees a `have` holds whole without reading them, so the cost follows the size of the change. `records/fetch` now only fetches records: revisions, statements and acceptances, each followed by the blob it carries (a description, a payload), and refuses blobs and trees. Both answers are bounded: a `Packer` fills packs up to `Pack::LIMIT`, 64 MiB, in order, and a fetch that stops short says so with the `origin-more` header. The SDK returns it as a `Part`; the caller asks again for what's left, the records after the last one it got, or the snapshot skipping the objects it got. `Store::read_each` reads the objects from every core in chunks of a few MiB, so the server stops reading once the part is full.
PiquelChips
force-pushed
the
feat/sync-snapshot-fetch
branch
from
November 22, 2026 19:20
32e7a55 to
5534b14
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 clone should only fetch the snapshots it reads, and a server should one day decide what each caller may read by path (#6). Fetching trees and blobs by id allows neither.
Snapshots leave by walking them:
POST snapshots/fetchwalks a snapshot from its root and sends the trees and blobs none of the caller's snapshots holds at the same path, parents first, optionally only under some paths.Store::addeddoes the walk, skipping subtrees ahaveholds whole without reading them, so the cost follows the size of the change.records/fetchnow only fetches records, each followed by the blob it carries (a description, a payload), and refuses blobs and trees.Bounded answers: a
Packerfills packs up toPack::LIMIT, 64 MiB, in order. A fetch that stops short sets theorigin-moreheader, which the SDK returns as aPart; the caller asks again for the rest. The server reads objects from every core in chunks of a few MiB, and stops once the part is full.Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)