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/node.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/node.rs') diff --git a/src/node.rs b/src/node.rs index 6fc8c66..3d1c882 100644 --- a/src/node.rs +++ b/src/node.rs @@ -176,6 +176,7 @@ impl Node { sync_events: sync_tx, change_tx, initial_sync_done: Arc::new(AtomicBool::new(false)), + writes_held: Arc::new(watch::channel(false).0), closing: Arc::new(watch::channel(false).0), change_events, timing: config.timing, -- cgit v1.3.1