diff options
| author | tv <tv@krebsco.de> | 2026-11-20 04:16:12 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-20 05:29:48 +0100 |
| commit | 7926a9764626878f5cc244286cce9eb502358929 (patch) | |
| tree | 7ba6082872afd464490feb296c4f54afbc5c80a9 /docs/lifecycle.md | |
| parent | 00cac6466057c2a8a92dae9e4cd46369e72bcad9 (diff) | |
keep-actor by default: the writer kept across a clean stop, writes held till a sync
A node that stopped cleanly writes on as the writer of before, as
`--keep-actor` had it, now by default: an epoch gathers a writer per node
and per crash, drop or rejoin, not per start. `keep-actor = false`, in a
configuration file, has a node write as a fresh writer each start; a
node without a document file has nothing to keep, which is no longer an
error.
Writing on as the writer of before, a node holds its writes (`mutate_doc`
and the API's through it) until it synced once with a ready neighbour,
level with it, or 10 seconds passed (`AppState::hold_writes`,
`KEPT_WRITER_WAIT`): a neighbour holding later changes of that writer,
which a copy of the node's files made (a backup restored, a disk rolled
back), hands them over first, and the node takes a fresh writer then, as
it did. A node that reaches no neighbour within the wait writes on.
Diffstat (limited to 'docs/lifecycle.md')
| -rw-r--r-- | docs/lifecycle.md | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/docs/lifecycle.md b/docs/lifecycle.md index a221063..41a4ddc 100644 --- a/docs/lifecycle.md +++ b/docs/lifecycle.md @@ -95,20 +95,22 @@ document file holding a document is an error with no override. by a crash is dropped when reading. A file is read only by a version that knows every kind of record in it: one a later version wrote is unusable to an earlier one, which doesn't start on it unless told to move it aside (`--force badDocumentFile`). A node starting from it is ready at once; sync - merges what it missed, or it rejoins a newer epoch. A node writes as a fresh actor - each start, unless `--keep-actor` and it stopped cleanly (the file marks a clean - stop, and the mark is undone as the node starts on it, before it decides its actor): - then it writes on as the actor of before, as nothing it wrote is missing. Where the - mark can't be undone (the disk full, say), it writes as a fresh one. Two nodes - started on copies of one file would both write on as that actor, and each one's - changes would be refused as forged by peers holding the other's: don't start a copy - of a node's data directory while the node runs, or after it, with `--keep-actor`. A - node receiving a change of its own actor that it didn't make, signed with its own - key, writes on as a fresh actor at once, and logs a warning (unsigned, it is - anyone's forgery: refused, and nothing switches); what both wrote before stays refused where the - other's came first. Fewer actors mean fewer signatures in every - transfer of the epoch's history (a writer each); a crash, a drop, or a switch or a - rejoin still starts a fresh one. + merges what it missed, or it rejoins a newer epoch. A node that stopped cleanly writes + on as the actor of before (`--keep-actor`, on by default), as nothing it wrote is + missing: the file marks a clean stop, and the mark is undone as the node starts on it, + before it decides its actor. Where the mark can't be undone (the disk full, say), or + the node didn't stop cleanly, it writes as a fresh one. Writing on as the actor of + before, it holds its writes (the API's among them) until it synced once with a ready + neighbour, or 10 seconds passed. Two nodes started on copies of one file, or a node on + an older copy of its own (a restored backup, a rolled-back disk), write as the same + actor: a neighbour holding the other copy's later changes hands them over within that + wait, and a node receiving a change of its own actor that it didn't make, signed with + its own key, writes on as a fresh actor at once, and logs a warning (unsigned, it is + anyone's forgery: refused, and nothing switches). What both wrote before stays refused + where the other's came first, so don't start a copy of a node's data directory while + the node runs; `keep-actor = false` has a node write as a fresh actor each start. + Fewer actors mean fewer signatures in every transfer of the epoch's history (a writer + each); a crash, a drop, or a switch or a rejoin still starts a fresh one. * **A backup** (`GET /admin/document`) is the whole document with its history, naming its swarm and epoch. `--recover-from` starts a node on it; `--genesis --remake import:FILE` starts a *new* swarm with its content; an `import` remake brings its |
