prometheus/tsdb/index
Marco Pracucci 501bc6419e
Add ShardedPostings() support to TSDB (#10421)
This PR is a reference implementation of the proposal described in #10420.

In addition to what described in #10420, in this PR I've introduced labels.StableHash(). The idea is to offer an hashing function which doesn't change over time, and that's used by query sharding in order to get a stable behaviour over time. The implementation of labels.StableHash() is the hashing function used by Prometheus before stringlabels, and what's used by Grafana Mimir for query sharding (because built before stringlabels was a thing).

Follow up work
As mentioned in #10420, if this PR is accepted I'm also open to upload another foundamental piece used by Grafana Mimir query sharding to accelerate the query execution: an optional, configurable and fast in-memory cache for the series hashes.

Signed-off-by: Marco Pracucci <marco@pracucci.com>
2024-01-29 11:57:27 +00:00
..
index.go Add ShardedPostings() support to TSDB (#10421) 2024-01-29 11:57:27 +00:00
index_test.go Add ShardedPostings() support to TSDB (#10421) 2024-01-29 11:57:27 +00:00
postings.go postings: use Loser Tree for merge 2023-12-08 16:07:25 +00:00
postings_test.go tsdb/index: add benchmark for Postings.Merge 2023-12-08 16:00:22 +00:00
postingsstats.go Fix int32 overflow issues (#12978) 2023-10-16 16:23:26 +02:00
postingsstats_test.go golangci-lint: enable testifylint linter (#13254) 2023-12-07 11:35:01 +00:00