prometheus/tsdb
Jesus Vazquez 7368402054 Fix OOO Head LabelValues and PostingsForMatchers
OOOHeadIndexReader was using the headIndexReader PostingsForMatchers()
and LabelValues() implementation which lead to a very subtle bug that
led to wrong query results.

headIndexReader LabelValues() implementation checks if the query
timerange overlaps with the head maxt and mint and if it doesnt it
returns an empty list of values. Since this code was also used by the
ooo head it led to wrong results that we were not able to see in tests
because our queries where always from MinInt64 to MaxInt64. This commit
also adds a new test that performs multiple time range queries to make
sure this never happens again.

Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>
2022-08-10 23:14:19 +02:00
..
agent Add out-of-order sample support to the TSDB () 2022-06-22 11:45:21 +00:00
chunkenc Add out-of-order sample support to the TSDB () 2022-06-22 11:45:21 +00:00
chunks Merge remote-tracking branch 'upstream/main' into update-upstream-prometheus 2022-07-13 10:18:09 +02:00
docs Update godoc links and remove note about TSDB versioning () 2022-05-26 18:34:43 +10:00
encoding Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
errors Address golint failures from revive 2021-10-23 00:53:11 +02:00
fileutil Make necessary change to compile promql parser to wasm () 2022-05-12 09:12:05 +02:00
goversion Add new Go build tags. 2021-08-27 10:24:14 +02:00
hashcache Merge remote-tracking branch 'upstream/main' into merge-upstream 2021-11-18 15:48:40 +01:00
index Remove use of io/ioutil. 2022-06-09 15:01:34 +02:00
record Add out-of-order sample support to the TSDB () 2022-06-22 11:45:21 +00:00
test Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
testdata tsdb: Delete blocks atomically; Remove tmp blocks on start; Added test. () 2020-08-11 06:56:08 +01:00
tombstones refactor: move from io/ioutil to io and os packages () 2022-04-27 11:24:36 +02:00
tsdbutil refactor: move from io/ioutil to io and os packages () 2022-04-27 11:24:36 +02:00
wal Add out-of-order sample support to the TSDB () 2022-06-22 11:45:21 +00:00
.gitignore Moving tsdb into its own subdirectory 2019-08-13 13:58:49 +05:30
async_block_writer.go Make linter happy 2022-02-10 15:32:02 +01:00
block.go Avoid gaps in in-order data after restart with out-of-order enabled () 2022-06-27 20:26:25 +05:30
block_test.go Include out of order samples in BenchmarkQueries () 2022-07-14 18:01:39 +05:30
blockwriter.go Add support to query unmerged, unsorted chunks () 2022-07-20 15:57:02 +05:30
blockwriter_test.go refactor: use T.TempDir() and B.TempDir to create temporary directory 2022-01-22 18:57:30 +08:00
CHANGELOG.md Rename default branch to main 2021-02-22 20:28:02 +01:00
compact.go Avoid gaps in in-order data after restart with out-of-order enabled () 2022-06-27 20:26:25 +05:30
compact_test.go Add out-of-order sample support to the TSDB () 2022-06-22 11:45:21 +00:00
db.go Prevent panic with ApplyConfig () 2022-08-09 19:25:17 +05:30
db_test.go Fix OOO Head LabelValues and PostingsForMatchers 2022-08-10 23:14:19 +02:00
example_test.go refactor: move from io/ioutil to io and os packages () 2022-04-27 11:24:36 +02:00
exemplar.go tsdb: use simpler map key to improve exemplar ingest performance () 2022-01-06 15:58:58 +05:30
exemplar_test.go unit tests: make all Labels sorted alphabetically () 2022-05-04 23:41:36 +02:00
head.go Update minOOOTime after truncating Head () 2022-08-02 19:43:50 +05:30
head_append.go Do not double count in OOO histogram () 2022-07-22 13:47:51 +05:30
head_append_test.go Merge pull request from grafana/add-jitter-to-chunk-end 2021-11-16 11:05:07 +01:00
head_bench_test.go Add out-of-order sample support to the TSDB () 2022-06-22 11:45:21 +00:00
head_read.go Add out-of-order sample support to the TSDB () 2022-06-22 11:45:21 +00:00
head_read_test.go Add out-of-order sample support to the TSDB () 2022-06-22 11:45:21 +00:00
head_test.go Update minOOOTime after truncating Head () 2022-08-02 19:43:50 +05:30
head_wal.go Merge remote-tracking branch 'upstream/main' into update-upstream-prometheus 2022-07-13 10:18:09 +02:00
isolation.go Add the ability to disable tsdb isolation () 2021-11-19 15:41:32 +05:30
isolation_test.go Add the ability to disable tsdb isolation () 2021-11-19 15:41:32 +05:30
mocks_test.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
ooo_head.go Add out-of-order sample support to the TSDB () 2022-06-22 11:45:21 +00:00
ooo_head_read.go Fix OOO Head LabelValues and PostingsForMatchers 2022-08-10 23:14:19 +02:00
ooo_head_read_test.go Rename OutOfOrderAllowance to OutOfOrderTimeWindow 2022-06-24 12:23:38 +02:00
postings_for_matchers_cache.go Merge remote-tracking branch 'upstream/main' into merge-upstream 2021-11-18 15:48:40 +01:00
postings_for_matchers_cache_test.go Necessary changes to make the merge work 2022-04-13 14:45:43 +02:00
querier.go Add out-of-order sample support to the TSDB () 2022-06-22 11:45:21 +00:00
querier_bench_test.go Add out-of-order sample support to the TSDB () 2022-06-22 11:45:21 +00:00
querier_test.go Include out of order samples in BenchmarkQueries () 2022-07-14 18:01:39 +05:30
README.md Update godoc links and remove note about TSDB versioning () 2022-05-26 18:34:43 +10:00
repair.go refactor: move from io/ioutil to io and os packages () 2022-04-27 11:24:36 +02:00
repair_test.go refactor: use T.TempDir() and B.TempDir to create temporary directory 2022-01-22 18:57:30 +08:00
symbols_batch.go Introduced some options for compactor concurrency () 2021-12-02 10:34:52 +01:00
symbols_batch_test.go Introduced some options for compactor concurrency () 2021-12-02 10:34:52 +01:00
tsdbblockutil.go tsdb: commit data periodically in CreateBlock () 2022-06-17 11:26:19 +05:30
wal.go fix potential goroutine leaks 2021-12-17 18:35:30 -05:00
wal_test.go refactor: move from io/ioutil to io and os packages () 2022-04-27 11:24:36 +02:00

TSDB

GoPkg

This directory contains the Prometheus TSDB (Time Series DataBase) library, which handles storage and querying of all Prometheus v2 data.

Documentation

External resources

A series of blog posts explaining different components of TSDB: