Expand description
Shared types, constants, and error definitions for the backup envelope.
Structs§
- Envelope
- Decoded envelope.
- Envelope
Meta - Header metadata captured at backup time.
- Section
- One contiguous body produced by one origin node.
- Source
Tombstone Entry - Single source-side tombstone entry.
purge_lsnis the Origin WAL LSN at which the hard-delete committed — restore uses it as a per-collection replay barrier so rows older than the purge don’t resurrect. - Stored
Collection Blob - Single catalog-row entry in a catalog-rows section. The outer
container is
Vec<StoredCollectionBlob>msgpack-encoded into the section body. Bytes are the zerompk-encodedStoredCollectionfrom thenodedbcrate —nodedb-typesintentionally doesn’t depend on thenodedbcatalog types, so the blob is opaque here.
Enums§
Constants§
- DEFAULT_
MAX_ SECTION_ BYTES - Default cap on a single section body: 16 GiB.
- DEFAULT_
MAX_ TOTAL_ BYTES - Default cap on total envelope size: 16 GiB. Tunable per call.
- HEADER_
LEN - Header is fixed-size — 52 bytes (48 framed + 4 crc).
- MAGIC
- SECTION_
ORIGIN_ CATALOG_ ROWS - Sentinel
origin_node_idvalues that mark sections carrying metadata rather than per-node engine data. Restore handlers recognize the sentinel and route the body to the correct catalog writer. Section CRCs validate independently of whether the reader acts on the section body. - SECTION_
ORIGIN_ SOURCE_ TOMBSTONES - SECTION_
OVERHEAD - Per-section framing overhead: origin(8) + len(4) + crc(4).
- TRAILER_
LEN - Trailing crc.
- VERSION
- Backup envelope version stamped in byte 4 of every envelope header. Both plaintext and encrypted envelopes use version 1; the presence of the crypto block (68 bytes after the header) distinguishes them.