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. --- docs/measurements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/measurements.md') diff --git a/docs/measurements.md b/docs/measurements.md index 2adc9ed..60eac40 100644 --- a/docs/measurements.md +++ b/docs/measurements.md @@ -39,7 +39,7 @@ whole seconds in JSON unless named `…Ms`; Prometheus has seconds throughout. | JSON | Prometheus | Meaning | |---|---|---| | `document.heads` | `document_heads` | Heads of the local document now. 1 means every change has been merged into one line of history; more means concurrent writes not yet followed by a merging write. | -| `document.writers` | `document_writers` | Writers (Automerge actors) with changes in the document, counted with the saved size. Each start, rejoin or drop of a node makes one (a start keeps the one of before with `--keep-actor` after a clean stop), and every transfer of the whole history carries a signature for each; a remake starts again from the writers that write in the new epoch. | +| `document.writers` | `document_writers` | Writers (Automerge actors) with changes in the document, counted with the saved size. Each rejoin or drop of a node makes one, and each start but after a clean stop (`--keep-actor`), and every transfer of the whole history carries a signature for each; a remake starts again from the writers that write in the new epoch. | | `document.maxHeads` | `document_max_heads` | The most heads seen right after applying a sync message. A high value shows how concurrent the swarm's writing gets; it also bounds keepalive size (above 32 heads, keepalives carry a digest and 32 of them). | | `document.savedBytes` | `document_saved_bytes` | The document as Automerge saves it (compressed): roughly what a joining node downloads and what a document file rewrite writes. Measured in the background, only after a change, at least a minute apart and at most 1% of the time (a document that takes 2 s to save is measured every 200 s at most); an export (`GET /admin/document`) counts as a measurement. `savedBytesSecsAgo` and `savedBytesTookMs` say how fresh and how costly. | | `document.lockWait.read`, `.write`: `count`, `sumUs`, `maxUs`, `buckets[]` (`leUs`) | `document_lock_wait_seconds{mode}` (histogram), `document_lock_wait_max_seconds{mode}` | How long takers of the document's lock waited for it, since start, by mode. Readers (the API's reads, topology, stats, generating sync messages, serving changes and deltas, saves) wait only for a writer; writers (applying sync messages and fetched changes, writes, epoch switches) wait for everyone. Buckets from 10 µs to 10 s, the last unbounded; not cumulative in JSON. | -- cgit v1.3.1