data/chunks_head/000001
Head Chunks (m-mapped)
When an in-memory head chunk fills up, it is flushed and memory-mapped from files
under chunks_head/. Unlike block chunks these files have no index,
so each chunk record carries its own metadata: the series reference it belongs to, plus
its mint/maxt. That's what makes WAL replay fast:
Prometheus can rebuild the head from these files without decoding sample data.
References work like block chunks: uint64 = segment sequence (upper 4 bytes)
‖ in-file offset (lower 4 bytes).
Open the interactive byte explorer →
Field notes & invariants
- The header magic differs from block chunks:
0x0130BC91vs0x85BD40DD. - The extra per-chunk fields (series ref, mint, maxt) exist precisely because there is no index file for these chunks; they are read during startup replay.
- The highest bit of the encoding byte marks an out-of-order (OOO) chunk. Block chunks never set this bit.
- Field order differs from block chunks: here
encodingcomes beforelen. - The checksum covers series ref through the end of data.
- Chunk 2's
datais the exact same native-histogram encoding shown on the Chunks page — the mmap wrapper around it (series ref/mint/maxt/OOO-bit) is encoding-agnostic and identical to chunk 1's.