Skip to main content

Module disk

Module disk 

Source
Expand description

Everything the worker reads from the store directory, as blocking calls.

The worker runs each of these on Tokio’s blocking pool (tokio::task::spawn_blocking), never on a runtime thread: a segment read can be 64 MiB, and a side file grows with the store’s history.

Structs§

DiskState
What one look at the store directory says.
ParentRecord
What PARENT_FILE holds.

Constants§

LINEAGE_FILE
The store file naming the backup lineage it belongs to.
PARENT_FILE
The store file a restore-on-boot writes: which lineage and restore point the store was restored from. Never uploaded (it is not a side file).

Functions§

crc32_of
CRC-32 of a whole file, read from its start; the file is left at its start again.
create_lineage
Give the store the backup lineage id: written to a temporary file, fsynced, renamed into place, and the directory fsynced. The one file the backup worker ever writes into a store directory.
create_parent
Write PARENT_FILE as create_lineage writes the lineage: a temporary file, fsynced, renamed into place, the directory fsynced.
floor
The store’s horizon floor (wal.floor), or 0.
ident_of
Ident of a file’s metadata, computed as the engine computes it.
local_archives
Every wal.N.archive in the directory, as (n, len), sorted by n.
observe
open_snapshot
snapshot.bin opened, with the identity of the file actually opened.
read_lineage
The store’s backup lineage, or None when it has never been backed up.
read_parent
The store’s parent record, or None when it has none (or one that does not parse: it then adopts nothing).
read_side
A side file’s identity, and its bytes when the identity differs from known. Ok(None) when the file does not exist.

Type Aliases§

Ident
A file’s identity as (len, mtime_nanos) — the form the engine uses for snapshot.bin (mushroomdb::WalPosition::snapshot).