From 7926a9764626878f5cc244286cce9eb502358929 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 20 Nov 2026 04:16:12 +0000 Subject: 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. --- src/config/mod.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/config') diff --git a/src/config/mod.rs b/src/config/mod.rs index 1f6ad60..672b8f8 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -410,8 +410,8 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[ "keep-actor", Kind::Flag, "BOOL", - Some("false"), - "Resume writing as the actor this node wrote with before it stopped, if it stopped cleanly (its document file holds everything it wrote then), instead of a fresh one: an epoch then gathers a writer per node and per crash or drop rather than per start, which every transfer of its history carries a signature for. Needs document-file.", + Some("true"), + "Resume writing as the actor this node wrote with before it stopped, if it stopped cleanly (its document file holds everything it wrote then), instead of a fresh one, holding its writes until it synced once with a ready neighbour, or 10s passed: an epoch then gathers a writer per node and per crash or drop rather than per start, which every transfer of its history carries a signature for. Without document-file, nothing is kept. Off (false, in a configuration file) a node writes as a fresh actor each start.", ), option( "document-append", @@ -1273,9 +1273,6 @@ impl Settings { if self.document_append.is_zero() || self.document_rewrite.is_zero() { bail!("document-append and document-rewrite must be longer than 0"); } - if self.keep_actor && self.document_file.is_none() { - bail!("keep-actor needs document-file: it tells whether this node stopped cleanly"); - } if self.keepalive < Duration::from_millis(100) { bail!("keepalive must be at least 100ms"); } -- cgit v1.3.1