Skip to main content

JOURNAL_TOMBSTONE

Constant JOURNAL_TOMBSTONE 

Source
pub const JOURNAL_TOMBSTONE: u64 = u64::MAX; // 18_446_744_073_709_551_615u64
Expand description

The blob_size of a journal row that is not a pack: a tombstone, whose blob_offset names a pack this archive has retired.

u64::MAX rather than 0, and that is the whole of the encoding decision. The journal’s schema is two u64s and a third column cannot be added without making every existing journal file unreadable by the writer that appends to it, so the marker has to live inside a value that no real pack can take. A zero-length append is at least conceivable — a caller handing append an empty slice gets (cursor, 0) — while an extent of 2^64-1 bytes cannot exist on any filesystem this will ever run on. The unreachable value is the safe one.