diff options
| author | tv <tv@krebsco.de> | 2026-11-16 17:17:05 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-16 18:29:38 +0100 |
| commit | f3c89a54e9e5f41fce32018b36c9913de04cb9cf (patch) | |
| tree | 423342fa84a8afb2334c2517c6b7a120bbf4a800 | |
| parent | 1f3b8ceef9608f73c53f06b6371cac5ec002dcf1 (diff) | |
store: one rule for putting events again
Events were put again by three rules: of a change continuum refused, every event of it
and of what was built on it; after a switch, what a node held beyond the base that the
new document lacked; after a rejoin, what it held. Between them an event could go: at a
remake whose base came before a checkpoint, switched after nodes moved to it, the
events between the base and its heads that the checkpoint didn't keep were in no node's
store and left the document, and a store starting at the snapshot's checkpoint could
reach the nodes' no more, pinned or not.
One rule now: a node puts again every event its document lacks that a store starting at
the document's checkpoint would take, but for its own refusals and drops, and that it
has: one it holds, one in a change it refused, or one the document it left held. So no
remake leaves out what a store starting at the new document's checkpoint takes, and the
document holds what a node forgot until a remake whose snapshot holds that checkpoint or
a later one.
| -rw-r--r-- | docs/store.md | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/docs/store.md b/docs/store.md index 12a5e34..a1d9c8c 100644 --- a/docs/store.md +++ b/docs/store.md @@ -58,10 +58,10 @@ them, and refuses such events from then on. The fold names heads that whatever m store move is above, so that moving refuses none of it. Judging an event after those heads needs nothing the node forgot, as the fold keeps what judging reads; and what is read from the checkpoint and the events after it is what the whole history reads, but -for what the fold lets a checkpoint forget. Its tests check both (Tests). Until the next -remake, the document still holds what a node forgot, and a node that was away syncs it -as any (On Automerge); after it, one that can't build the checkpoint takes it where its -operator pins it. +for what the fold lets a checkpoint forget. Its tests check both (Tests). Until a remake +whose snapshot holds that checkpoint or a later one, the document still holds what a +node forgot, and a node that was away syncs it as any (On Automerge); after it, one that +can't build the checkpoint takes it where its operator pins it. ### Pinned checkpoints @@ -252,12 +252,17 @@ nobody takes, or one a checkpoint forgot, stays in the document until the next r leaves it out (Remakes). Which change put an event, and how often, changes nothing, so honest nodes hold one document, whatever each reads from it. -Continuum still refuses some changes on its own, by what they are or who wrote them: of -a writer's two changes of one number, the second (Where Automerge sets limits). A node -that refuses such a change puts again, in changes of its own, every event of it, and of -what is built on it, read from those changes' own operations, each after its -dependencies: so that what it carried still reaches the store, and the documents those -two changes part hold the same events. +**A node puts again**, in changes of its own, every event its document lacks that a store +starting at the document's checkpoint would take, but for the node's own refusals and +drops, and that the node has: one it holds, one in a change it refused, or one the +document it left held, at a switch or a rejoin (Remakes). It puts each after its +dependencies, once a short wait of its own has passed, random, so that not every node +puts the same, and none another node put meanwhile. Each event is taken again as it was: +its history is there too. Continuum still refuses some changes on its own, by what they +are or who wrote them: of a writer's two changes of one number, the second (Where +Automerge sets limits); what such a change carried still reaches the store, and the +documents those two changes part hold the same events. And no remake leaves out an +event a store starting at the new document's checkpoint takes. ### Members @@ -303,22 +308,22 @@ record (its ID, its coordinator): two remakes at one base are two epochs. its coordinator's alone, and so is its abort. **Of two epochs decided for one**, by a coordinator that wrote two decisions or by remakes decided at once, a node follows the one with the lower ID, and a node on the other rejoins it. -* **After it switches**, a node puts again what it holds beyond the base that the new - document lacks, each event after its dependencies, once a short wait of its own has - passed, random, so that not every node puts the same. Each event is taken again as it - was: its history is in the new epoch too. A node that moved to a later checkpoint - since the base keeps its own, and reads none of what the snapshot holds that its - checkpoint forgot, as it read none of it in the old document. +* **After it switches**, a node puts again what the new document lacks (What the store + takes from the document): what it holds beyond the base, and, where it moved to a + later checkpoint since the base, what the old document holds that a store starting at + the snapshot's checkpoint takes to reach that one. A node that moved to a later + checkpoint since the base keeps its own, and reads none of what the snapshot holds + that its checkpoint forgot, as it read none of it in the old document. * **A node that rejoins**, as it was away, lacks the base, or is on the higher of two epochs, takes the epoch its peers give it, or the one its operator pins, as continuum's node rejoins. It keeps its own checkpoint and reads from the new document what is above its heads, judging every event; a later checkpoint the snapshot holds, which it can't build from what it holds, it takes only where its operator pins it - (Pinned checkpoints). It puts again what it held. What its own refusals and its - operator's drops refuse, it reads none of. A node with an empty document does the - same, from the root its operator names or a checkpoint its operator pins. A made-up - epoch can withhold events from it, and keep it apart from the others, but make it take - nothing it wouldn't. + (Pinned checkpoints). It puts again what the new document lacks, as after a switch. + What its own refusals and its operator's drops refuse, it reads none of. A node with + an empty document does the same, from the root its operator names or a checkpoint its + operator pins. A made-up epoch can withhold events from it, and keep it apart from the + others, but make it take nothing it wouldn't. So a remake changes no event a node holds, only which document carries them, which the fold never sees. A swarm that never remakes holds what one that remakes all the time @@ -375,7 +380,7 @@ crafted changes. *Sim*: a simulation. *Bench*: measured, not judged. | 13 | A coordinator shows one of two decisions for an epoch to some nodes, the other to the rest | Nodes on the higher epoch rejoin the lower: no operator needed | sim | | 14 | A decision or abort written by a node not its coordinator | Refused | unit | | 15 | A node with an empty document handed a made-up epoch | It takes its checkpoint only where it builds it, or its operator named or pinned it, and judges every event after it: the epoch withholds, at worst | sim | -| 16 | A node away while the others switch | It rejoins: reads what is above its checkpoint, judging every event, and puts again what it held; a later checkpoint it can't build it takes where its operator pins it | sim | +| 16 | A node away while the others switch | It rejoins: reads what is above its checkpoint, judging every event, and puts again what the new document lacks; a later checkpoint it can't build it takes where its operator pins it | sim | | 17 | A token from another node | Refused: a node takes only its own | unit | | 18 | A node writing another node's entry, or under `_continuum` where this doesn't say | Refused | unit | | 19 | A group naming many nodes, to be every node's neighbours | Each node keeps some among its own group's and those its operator names | sim | @@ -383,11 +388,11 @@ crafted changes. *Sim*: a simulation. *Bench*: measured, not judged. | 21 | A node no longer a member decides a remake, its decision brought by a member | Followed as any decision: a remake changes no event | unit | | 22 | A checkpoint a node can't build, handed to it by peers | Taken only where its operator pinned it | unit | | 23 | An event not above the heads of the checkpoint a node moved to | Not taken; the change that carries it is, and stays in the document until the next remake | unit | -| 24 | A node away while the others moved to a checkpoint and forgot what came before | It builds the checkpoint from the document, which holds what came before until the next remake; after it, it takes it where its operator pins it | sim | +| 24 | A node away while the others moved to a checkpoint and forgot what came before | It builds the checkpoint from the document, which holds what came before until a remake whose snapshot holds that checkpoint or a later one; after it, it takes it where its operator pins it | sim | | 25 | Heads for a checkpoint before the store's, or one in another's history | No move: the fold names none such | unit | | 26 | A head brought again after a move | Taken as held, and not read anew | unit | | 27 | An operator has its node drop an event its checkpoint keeps | Refused: a node drops only events after its checkpoint | unit | -| 28 | A remake whose base comes before a checkpoint, switched after nodes moved to it | They switch, keep their checkpoint, and read none of what it forgot | sim | +| 28 | A remake whose base comes before a checkpoint, switched after nodes moved to it | They switch, keep their checkpoint, read none of what it forgot, and put again from the old document what a store starting at the snapshot's checkpoint takes to reach theirs | sim | | 29 | Flooding: events, writers, history, remakes | Slow, or out of memory; not wrong | bench | | 30 | A member decides compactions, grinding their IDs until the new epoch's ID is lower than the honest one's | Nodes on the honest epoch rejoin the lower, once a generation; no event is lost: slow, not wrong | sim | |
