data/wal/000004

WAL

Every ingested sample hits the write-ahead log before it is acknowledged, so a crash cannot lose acknowledged data. Segments are numbered files (000000, 000001, …) capped at 128 MB, written in 32 KB pages, a framing borrowed from LevelDB/RocksDB. A record that doesn't fit the rest of a page is split into first/middle/last fragments; records never span segment boundaries.

Inside the framing, each record type has its own encoding. Series records name and number the series; sample records then refer to them by ID. That's why WAL replay must see series records before their samples, and why checkpoints rewrite them.

Open the interactive byte explorer →

Field notes & invariants

← All TSDB formats