Expand description
ColumnChunk: differential’s Chunk over ColumnBody updates.
A chunk is a sorted, consolidated run of (D, T, R) updates in the flat
columnar layout, in one of two homes:
- Resident: an
Rc-sharedColumnBodyon the heap. Fresh input, merge output, and small tails live here. - Spilled: the serialized body in the process
Pool, with the record count and the first and last data items resident. The pool owns residency from there, with slots under a memory budget and compression and device pageout under pressure, and a body that dies before pressure reaches it is freed without I/O.
Reads of a spilled body are copy-out and scoped to the call that needs
them, the contract that lets the pool evict with no reader accounting
(see mz_ore::pool).
Spilling happens in Chunk::settle, the trait’s designated commit point:
chunks moved to settled output are handed to the pool while the chunk
type’s SpillGate is open. Grading is by serialized
bytes, the ship size Column already targets, rather than by the
record-count TARGET, since record count does not bound bytes for
variable-width data.
Chunks whose data is a (key, val) pair additionally implement
UnloadChunk, the bulk-read capability: sorted probe keys in, matching
updates appended to caller-owned staging, with locate answered from the
resident fence metadata so a probe set faults only the chunk bodies it
actually touches.
Modules§
- metrics
- Process-wide work counters for columnar chunk maintenance.
Structs§
- Accounted
Chunk Merger - The chunk merger of
AccountedChunkBatcher: differential’s merger with a resident readied side, plus theMerger::allocationfigures themz_arrangement_batcher_*_rawintrospection tables are assembled from. - Chunk
Chunker - A chunker for
arrange_coreoverColumnChunks: sorts and consolidates raw input columns through aColumnChunkerand wraps its output chunks. - Lz4Codec
- The chunk-side
ExtentCodec: a little-endianu32body-length prefix followed by one lz4 block, the framinglz4_flex::block::compress_prepend_sizeproduces. Every chunk consumer passesLZ4_CODECat insert; the pool itself has no codec opinion. - Spilled
Body - A spilled chunk body: the serialized column in the pool, plus the resident
metadata every
Chunkmust answer without fetching. That metadata is the record count, the first and last data items (the fence entriesUnloadChunk::locateconsults), and the time boundsextractconsults to pass frontier-disjoint chunks through without loading them. - Unchunk
Builder - A batch builder over
ColumnChunkinput that delegates to a builder overColumnBodyinput, loading each chunk’s body as it is pushed.
Enums§
- Column
Chunk - A sorted, consolidated run of
(D, T, R)updates, resident or spilled. - Compute
Spill - The gate of compute’s chunk batchers. See
set_compute_spill_enabled. - Storage
Spill - The gate of storage’s upsert chunk batchers. See
set_storage_spill_enabled.
Statics§
- LZ4_
CODEC - The
Lz4Codecinstance chunk consumers pass toPool::insert_with.
Traits§
- Chain
State - A builder whose batches carry state derived from a whole chain, computed before the chain’s first push.
- Spill
Gate - Which process-wide gate decides whether a
ColumnChunkspills.
Functions§
- set_
compress_ min_ depth - Set the youngest generational depth whose spilled bodies are compressed.
- set_
compute_ spill_ enabled - Enable or disable spilling of
ComputeSpillchunks. Already-spilled chunks are unaffected either way. - set_
sink_ spill_ enabled - Enable or disable spilling of bodies offered through
try_spill_ref, which is how compute’s MV sink correction buffer spills. Like theSpillGates, it takes effect only onceapply_pool_confighas installed the pool. - set_
spill_ override - Set or unset the pool through which this thread’s chunk spills are
routed, taking precedence over the gates and the process pool.
Nonerestores the global resolution. - set_
storage_ spill_ enabled - Enable or disable spilling of
StorageSpillchunks. Already-spilled chunks are unaffected either way. - try_
spill_ ref - Spill a serialized copy of
bodyinto the process pool, leavingbodyuntouched, orNonewhen the body stays resident.
Type Aliases§
- Accounted
Chunk Batcher - The
ChunkBatcherof a chunk chain, reporting resident bytes to the batcher size logger.