prometheus/storage
Ganesh Vernekar 9eb78735cf
Some checks failed
buf.build / lint and publish (push) Has been cancelled
CI / Go tests (push) Has been cancelled
CI / More Go tests (push) Has been cancelled
CI / Go tests with previous Go version (push) Has been cancelled
CI / UI tests (push) Has been cancelled
CI / Go tests on Windows (push) Has been cancelled
CI / Mixins tests (push) Has been cancelled
CI / Build Prometheus for common architectures (push) Has been cancelled
CI / Build Prometheus for all architectures (push) Has been cancelled
CI / Check generated parser (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
CI / fuzzing (push) Has been cancelled
CI / codeql (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CI / Report status of build Prometheus for all architectures (push) Has been cancelled
CI / Publish main branch artifacts (push) Has been cancelled
CI / Publish release artefacts (push) Has been cancelled
CI / Publish UI on npm Registry (push) Has been cancelled
Merge pull request #16929 from prometheus/codesome/stale-series-compaction
tsdb: Early compaction of stale series

Closes #13616

Based on https://github.com/prometheus/proposals/pull/55

Stale series tracking was added in #16925. This PR compacts the stale series into its own block before the normal compaction hits. Here is how the settings:

stale_series_compaction_threshold: As soon as the ratio of stale series in the head block crosses StaleSeriesImmediateCompactionThreshold, TSDB performs a stale series compaction and puts all the stale series into a block and removed it from the head, but it does not remove it from the WAL. (technically this condition is checked every minute and not exactly immediate)
Additional details

WAL replay: after a stale series compaction, tombstones are added with (MinInt64, MaxInt64) for all these stale series. During WAL replay we add a special condition where when we find such tombstone, it immediately removes the series from the memory instead of storing the tombstone. This is required so that we don't spike up memory during WAL replay and also don't keep the compacted stale series in the memory.
Head block truncation ignores this block via the added metadata, similar to out-of-order blocks.
2026-01-24 15:18:17 -08:00
..
remote otlptranslator: filter __name__ from OTLP attributes to prevent duplicates (#17917) 2026-01-24 16:44:08 +01:00
buffer.go storage/buffer.go: add ST to sample types and iterators 2026-01-14 13:15:10 +01:00
buffer_test.go add test coverage for buffer.go 2026-01-14 13:15:17 +01:00
errors.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
errors_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
fanout.go fix: appenderV2 mock exemplar appendErr injection before appending it 2026-01-16 10:47:00 +00:00
fanout_test.go tests(teststorage): Close Storage in the helper (#17902) 2026-01-23 08:41:35 +00:00
generic.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
interface.go Merge pull request #17835 from prometheus/bwplotka/a2-storage-support 2026-01-16 13:04:14 +00:00
interface_append.go fix: appenderV2 mock exemplar appendErr injection before appending it 2026-01-16 10:47:00 +00:00
interface_test.go feat(tsdb): new AppenderV2 and AtST interface for chunks 2026-01-14 13:15:09 +01:00
lazy.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
memoized_iterator.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
memoized_iterator_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
merge.go feat(tsdb): new AppenderV2 and AtST interface for chunks 2026-01-14 13:15:09 +01:00
merge_test.go test that ChainSampleIterator passes on the AtST call 2026-01-14 13:15:18 +01:00
noop.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
secondary.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
series.go tsdb: Add unit tests for stale series compaction 2026-01-23 18:07:34 -08:00
series_test.go test ListSeriesIterator with ST 2026-01-14 13:15:19 +01:00