Commit Graph
3 Commits
Author SHA1 Message Date
david 42b03db2fa Immutable blocks with mmap reads
Flush sealed head chunks to ULID-named block directories on disk. Each
block contains CRC'd chunk segment files (mmap'd for reads), a binary
index (symbol table, series, postings with TOC), and a meta.json written
last as the immutability gate. WAL is truncated after block fsync,
preserving the crash-safety ording invariant.
2026-07-04 14:59:39 -04:00
david 376d3faf25 In-memory head with WAL
Head connects chunkenc and WAL: label-to-ref resolution with striped
concurrent maps, active Gorilla chunk per series sealing at 120 samples,
and an Appender that buffers samples, writes WAL on commit, then applies
to head. OOO rejection checks both committed and batch state. WAL replay
on Open rebuilds the full in-memory state. Exported
ChunkAppender/ChunkIterator interfaces from chunkenc.
2026-07-04 14:36:24 -04:00
david 06a95597e9 chunkenc
Bitstream primitives (bstream) and XOR encoder/decoder following the
Prometheus TSDB variant of the Gorilla scheme. Delta-of-delta timestamps
with 14/17/20/64-bit buckets, XOR-compressed float64 values. Decoder is
total: arbitrary bytes produce values or ErrShortStream.
2026-07-04 11:42:06 -04:00