Repository navigation
feat(api): put records only onto the heads the client saw - #125
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-conditional-put
branch
2 times, most recently
from
November 22, 2026 16:40
207897d to
34278f4
Compare
PiquelChips
force-pushed
the
feat/sync-conditional-put
branch
from
November 22, 2026 18:54
34278f4 to
672666f
Compare
A push made from a stale view of a change would make it diverge on the server. `PUT records?expect=<change>=<head>+<head>,...` makes a put a compare-and-swap: the server checks that each change it names still has those heads while it publishes the revisions, and refuses with a conflict otherwise, publishing no record (snapshots, which change nothing, stay). The check and the publication hold one lock, `Store::lock_pushes`, which every put of revisions takes, and so does the landing queue before it publishes a rebase, once the head it rebased is still the change's only one: a push and a rebase never both move a change. A rebase that finds the change moved fails with `LandError::Moved`. `POST changes/inventory` tells a client what the server holds of some changes, their revisions, heads and statements by id, so it knows what to send and which heads to expect. And `GET log` takes a `limit`, so a client can check the server has one acceptance without reading the whole chain.
PiquelChips
force-pushed
the
feat/sync-conditional-put
branch
from
November 22, 2026 19:20
672666f to
a706f08
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 made from a stale view of a change would make it diverge on the server.
Compare-and-swap puts:
PUT records?expect=<change>=<head>+<head>,...is refused with a conflict unless each change it names still has those heads when its revisions are published. A refused put publishes no record.Store::lock_pushes. The landing queue takes it too before it publishes a rebase, and checks that the head it rebased is still the change's only one. So a push and a rebase never both move a change. That covers queue rebases too.What a client needs to push:
POST changes/inventorytells a client what the server holds of some changes: their revisions, heads and statements, by id.GET logtakes alimit, so a client can check the server has one acceptance without reading the whole chain.Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)