Skip to main content

seal

Function seal 

Source
pub fn seal(b: &mut [u8], gen: u64)
Expand description

Stamp the checksum over current contents. Called by the pool immediately before write_at, and nowhere else: checksummed going to the medium, verified coming back, in between it is just memory (DuckDB: block manager; SQLite: cksumvfs – both at the I/O boundary, never per pin). Stamp the publishing generation into the (formerly reserved) lsn field, then checksum. Called at the ONLY two places bytes leave for disk (flush_all, eviction), so every on-disk page carries the generation of the epoch that wrote it – the ordering signal recovery’s duplicate-key collapse needs once page numbers are recycled (2n). In-memory finalise(0) call sites are untouched: the stamp happens on the way out.