diff options
| author | tv <tv@krebsco.de> | 2026-11-12 02:07:21 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-12 03:26:51 +0100 |
| commit | 62fd76ff79404ff1c474248f6ce4c13494b52866 (patch) | |
| tree | 4b31af412a7d4faeaed6fd7d473466d0118a21d5 /src | |
| parent | 97ae0ccf8eb0c0082d3989086f6c8258cd685625 (diff) | |
document file: say which versions read a file, and the Opened record
The document file's format names itself in its first line
(continuum-document/2) and each record's kind in its first byte. A
record of a kind the reading version doesn't know makes the file
unusable: the node doesn't start on it unless told to move it aside
(--force badDocumentFile). lifecycle.md says so: a file one version
wrote is read only by versions knowing every kind of record in it. The
format's comment names the Opened record a node appends as it starts on
the file, which undoes the clean stop's mark.
Diffstat (limited to 'src')
| -rw-r--r-- | src/document/file.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/document/file.rs b/src/document/file.rs index 1a33918..54ab9af 100644 --- a/src/document/file.rs +++ b/src/document/file.rs @@ -7,10 +7,11 @@ //! many bytes, the first of them its kind (`Record`): first a full save of the document, //! then increments (the changes after the heads written before), and the signatures of //! its changes (`document::signatures`), those the file holds none of yet, as -//! `signatures::pack` packs them; last, at a clean stop, an empty `Closed` record: the -//! file holds everything the node wrote, so it may resume as `current` -//! (`--keep-actor`). A record cut short by a crash is dropped when -//! reading. A file of `continuum-document/1` has records of the document alone, +//! `signatures::pack` packs them; at a clean stop, an empty `Closed` record: the file +//! holds everything the node wrote, so it may resume as `current` (`--keep-actor`); and +//! as a node starts on the file, before it writes anything, an empty `Opened` record, +//! which undoes that mark. A record cut short by a crash is dropped when reading; one of +//! a kind this version doesn't know (a later version's) makes the file unusable. A file of `continuum-document/1` has records of the document alone, //! without their kind: a full save, then increments. //! //! Written by a worker (`swarm::document_file`), only while the node is ready and not |
