mirror of
https://github.com/prometheus/prometheus.git
synced 2024-09-22 00:37:37 -07:00
9d388941ef
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
4.1 KiB
4.1 KiB
Tombstones Disk Format
The following describes the format of a tombstones file, which is the directory of a block.
The last 8 bytes specifies the offset to the start of Stones section. The stones section is 0 padded to a multiple of 4 for fast scans.
┌────────────────────────────┬─────────────────────┐
│ magic(0x130BA30) <4b> │ version(1) <1 byte> │
├────────────────────────────┴─────────────────────┤
│ ┌──────────────────────────────────────────────┐ │
│ │ Ranges 1 │ │
│ ├──────────────────────────────────────────────┤ │
│ │ ... │ │
│ ├──────────────────────────────────────────────┤ │
│ │ Ranges N │ │
│ ├──────────────────────────────────────────────┤ │
│ │ Stones │ │
│ ├──────────────────────────────────────────────┤ │
│ │ Ref(stones start)<8b> │ │
│ └──────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────┘
Ranges
┌──────────────────────────────────────────┐
│ ┌──────────────────────────────────────┐ │
│ │ #ranges <uvarint> │ │
│ ├───────────────────┬──────────────────┤ │
│ │ mint <varint64> │ maxt <varint64> │ │
│ ├───────────────────┴──────────────────┤ │
│ │ . . . │ │
│ ├──────────────────────────────────────┤ │
│ │ CRC32 <4b> │ │
│ └──────────────────────────────────────┘ │
└──────────────────────────────────────────┘
Stones
┌──────────────────────────────────────────┐
│ ┌──────────────────────────────────────┐ │
│ │ #stones <4b> │ │
│ ├───────────────────┬──────────────────┤ │
│ │ ref <4b> │ offset <8b> │ │
│ ├───────────────────┴──────────────────┤ │
│ │ . . . │ │
│ └──────────────────────────────────────┘ │
└──────────────────────────────────────────┘
The offset here is the offset to the relevant ranges.