diff options
| author | tv <tv@krebsco.de> | 2026-11-30 18:04:00 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-30 18:04:00 +0000 |
| commit | 4deaec75e49b7f0853c2b82bbcce129d19dcff51 (patch) | |
| tree | 2a6f047785b7a77428b126ccde5b68c4991c524f | |
| parent | e5906aee9199ef9f92d9005b97b7b75fb09e97b4 (diff) | |
docs: moving a swarm holding a store to sets of events
operations.md says how, step by step; document.md what is built of it;
the change log that it is there.
| -rw-r--r-- | CHANGELOG.md | 5 | ||||
| -rw-r--r-- | docs/document.md | 26 | ||||
| -rw-r--r-- | docs/operations.md | 34 |
3 files changed, 58 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7103cb2..abdf4c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,10 @@ it from the release before ([`docs/operations.md`](docs/operations.md), on by their names, nodes catch up by ranges of names and their fingerprints, and a node that starts with nothing asks members for the root, or the checkpoint `--store-checkpoint` names, by its name. What a checkpoint forgot is kept for - `--store-keeps-forgotten` (30 days). A swarm on Automerge doesn't move to it yet + `--store-keeps-forgotten` (30 days). A swarm on Automerge moves to it node by node, + each node for a while of both kinds (`--store-both`): it syncs with nodes of either, + and carries between them ([`docs/operations.md`](docs/operations.md), + [Moving to sets of events](docs/operations.md#moving-to-sets-of-events)) ([`docs/document.md`](docs/document.md), [A set of events](docs/document.md#a-set-of-events); [`src/federation/store/set.rs`](src/federation/store/set.rs), diff --git a/docs/document.md b/docs/document.md index dd1a942..07f25b0 100644 --- a/docs/document.md +++ b/docs/document.md @@ -634,10 +634,10 @@ among nodes that don't trust each other, no cut by time holds. ## A set of events -A kind, `events`, for a swarm holding a store ([`store.md`](store.md)): built, but for -the node of both kinds a running swarm moves by -([From an Automerge document to this](#from-an-automerge-document-to-this)); a node -is of it where its operator says so ([As built](#as-built), below). The +A kind, `events`, for a swarm holding a store ([`store.md`](store.md)): built. A node +is of it where its operator says so ([As built](#as-built), below), and a swarm on +Automerge moves to it node by node +([From an Automerge document to this](#from-an-automerge-document-to-this)). The store asks nothing of what carries its events, and what makes an Automerge document carry them is most of what a swarm holding a store has to get right ([On Automerge](store.md#on-automerge)): the changes that may write an event, the @@ -768,8 +768,22 @@ without a new federation and without a vote, by **a node of both kinds for a whi release whose node can hold the store in both at once, a member of both, and takes into each what the other holds, as it puts events again today. Operators move their nodes one at a time; once none is of the old kind, the next release drops it for a swarm -holding a store. From the release that has this kind, no swarm holding a store is -started on Automerge: one that runs there runs on, until it has moved. +holding a store. + +Built: a node given `--store-both` beside `--store-document` holds its store in the +Automerge document and in a set ([`swarm/set.rs`](../src/swarm/set.rs), +`Holding::of_both`). It takes handshakes of either kind and says to each peer the kind +that peer holds; passes the Automerge document on to the ones and its set to the +others; puts into the document what its set took of peers on sets, and passes on to +them what its set took of the document; and writes its entry in both. Its set, without +a file yet, is made of the store as the node reads it of its document, so it begins +where the document does, a checkpoint a remake left among it. Nodes on the document +alone and nodes on a set alone take none of each other's handshakes: what goes between +them goes through the nodes of both +([`operations.md`](operations.md), [Moving to sets of events](operations.md#moving-to-sets-of-events)). + +Not built: that no swarm holding a store is started on Automerge any more. One that +runs there runs on, until it has moved. ## What others do diff --git a/docs/operations.md b/docs/operations.md index e99a914..b12af28 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -155,6 +155,40 @@ A node upgrades by restarting with its files. What to know: (`automerge` in `--version`), and a release changing it says so in the change log. * **The dashboard** reloads by itself once its node serves another version of it. +## Moving to sets of events + +A swarm holding a store keeps it in the Automerge document, or in a document of the +store's own kind, a set of events ([`document.md`](document.md), +[A set of events](document.md#a-set-of-events)): no changes, writers, epochs or remakes, +and nothing to compact but by the federation's checkpoints. A running swarm moves there +node by node, the federation as it is: its root, its events and its votes are the same. + +Nodes on the document alone and nodes on a set alone don't sync with each other. Nodes +of both kinds do with either, and carry between them, so move every node through that: + +1. **Every node on a release that has sets** (`--version` says wire versions up to 53 + at least), one at a time, as any upgrade. +2. **Every node of both kinds**, one at a time: start it again with `--store-document + PATH`, a new file, and `--store-both`, everything else as it was, its + `--document-file` and `--store-file` among it. It goes on with its document, makes + its set of the store it reads there, and keeps it in the file. +3. **Every node on its set alone**, one at a time, once all are of both: start it + again without `--store-both`, `--document-file` and `--store-file`. It goes on from + the set's file. + +Between the steps, the swarm works as ever: an event put on any node reaches every +node. Within a step, it works as long as the nodes of both kinds reach each other and +every other node reaches one of them; `GET /events` on each node shows whether its +store holds what the others' hold (`heads`). + +A node that joins later is given `--store-id`, `--store-document` and seeds: with +nothing of the store, it asks the members it reaches for the root by its name, or, with +`--store-checkpoint`, for that checkpoint. + +Don't remake while nodes are of both kinds: a node of both follows a remake as any node +on the document, but that it then carries on between the two is not something a test +covers. + ## Behind a reverse proxy The HTTP API speaks plain HTTP on `127.0.0.1:3000`; a reverse proxy in front adds TLS. |
