Expand description
Copy a sealed block to an object store before retention unlinks it.
The whole module is one idea. A block directory’s name already carries its
own time range, node and sequence (section 3.2), so a flat namespace of
those names is the catalog: Target::list is one call to the store’s
own list API and nothing here writes an index, a manifest or a marker
beside the blocks. There is no second thing to keep consistent, which is
what principle 4 asks for — kill the process mid-sweep and the only state
is what the store lists, which is the same answer before and after.
Four limits, all deliberate:
- Only sealed, immutable blocks already past the retention cutoff are
uploaded. The hot path does not reach this module and the upload happens
on the retention worker’s
spawn_blockingthread, once a minute. - An offloaded block is never mapped.
Target::pullcopies it back into the data directory and the read path opens it there, so section 9’s refusal tommapa networked filesystem holds unchanged: this is a read of bytes, not a mapping of them. - A block is deleted locally only after its copy is visible in the store under its final name. The direction of the failure is fixed — a crash leaves two copies, never zero.
file://is the only scheme implemented. SeeTarget::parse.
Structs§
- Target
- Where offloaded blocks go. Parsed from
--offload.
Functions§
- copy_
block 🔒 - Stage a whole block directory into
root/.tmp, then rename it into place. - copy_
file 🔒 - Copy one file’s bytes, giving the destination a current modification time.
- copy_
files 🔒 - differs 🔒
- Why two copies of one block name are not the same block, or
None. - fsync_
dir 🔒 - sizes 🔒
(file name, length)for the regular files directly indir, sorted.- split 🔒
(partition, block name)out of…/<signal>/p=<hour>/<block>.