Repository navigation
Commit 4cc291e
committed
feat: add clone, push, fetch and remote landing
Nodes share work with one remote: a server over HTTP, or another
repository's path served by an in-process OriginService. `Remote` answers
the same calls either way.
A clone follows `policy` and one target: it fetches their chains, with
the revisions they landed and the records of their changes, and only the
tip's snapshot. Each acceptance must follow the one before it, and is
verified against the authority of the policy governing it: an acceptance
of `policy` by the one before it, any other by the policy it names, which
must be on the verified chain of `policy`. Acceptances only stored, like a
revision's base, govern nothing. Other snapshots are fetched when a
command reads them, marked while they're fetched, so an interrupted fetch
is never taken for a whole snapshot. Snapshots only leave a repository by
walking them (`POST snapshots/fetch`, skipping what the caller's snapshots
hold at the same path, optionally under some paths), so #6 can filter
reads by path; records are fetched by id, with the description or payload
they carry. A move of the working copy fetches what it needs before it
publishes `moving`, so one that cannot reach the remote moves nothing.
Fetched chains append several acceptances at once: recovering such an
append a crash cut short logs that the target advanced to each of them.
`push` compares each change's heads with the remote's inventory and
refuses a stale change before uploading anything, and the server checks
the heads again as it publishes the revisions (`PUT records?expect=`), so
a push racing another is refused too. It sends snapshots, then revisions,
then statements, each after what it needs, and says which statements stay
because they need one the remote lacks. It only shares revisions based on
acceptances the remote has. Transfers go in parts of at most 64 MiB, both
ways. `fetch` brings new acceptances, then the records of the changes the
remote's events since the last fetch say moved, so a fetch that brings
nothing doesn't grow with the history; without a cursor, or once it
expired, it compares every change it knows. `pull` fetches, then rebases
the working copy onto its target's tip. `land`, `land --from` and `target
new` go to the remote's queue for every target it has; `watch` long-polls
its events.1 parent 075c601 commit 4cc291e
35 files changed
Lines changed: 6100 additions & 553 deletions
File tree
- apps/origin-src
- benches
- src
- store
- workspace
- tests
- common
- crates
- origin-client/src
- docs
- tools/xtask/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
34 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
81 | 106 | | |
82 | 107 | | |
83 | 108 | | |
| |||
116 | 141 | | |
117 | 142 | | |
118 | 143 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
122 | 151 | | |
123 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
124 | 156 | | |
125 | 157 | | |
126 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
0 commit comments