You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(ingester): invalidate head postings cache per-label instead of per-metric
The head expanded postings cache previously keyed a per-metric "seed" into
the cache key, so creating or deleting any series for a metric invalidated
every cached entry for that metric name, even entries whose result could not
have changed.
Replace the seed with a per-(tenant, label) write counter. On series
create/delete each of the series' label counts is incremented. On creation, a cache entry
snapshots the counts of its matched labels and stays valid as
long as at least one tracked count is unchanged. Creating or deleting a series which matches
all of the tracked labels expires the cache entries.
Matchers that can match an absent label (e.g. foo!="x", foo=~".*") are
excluded from the snapshot since a matching series need not carry the label,
so they cannot vouch for an entry. Name-only queries fall back to the old
whole-metric behaviour via the __name__ count.
The counter array is shared across tenants and namespaced by userId. The size
is configurable via the newly added expanded_postings_cache.head.label-counter-size
flag. Also adds a reason="invalidated" value to the cache miss metric to distinguish count
invalidation from TTL expiry.
Signed-off-by: Kyle Stang <kylestng@amazon.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@
37
37
*[ENHANCEMENT] Querier: Detach series label and chunk data from gRPC unmarshal buffers in store-gateway streaming path, allowing the Go GC to reclaim receive buffers. #7519
38
38
*[ENHANCEMENT] Distributor: Added `cortex_distributor_received_histogram_buckets` metric to track number of buckets in received native histogram samples before validation, per user. #7569
39
39
*[ENHANCEMENT] Ingester: Add lazy regex evaluation on head postings cache miss. Defers expensive regex matchers on high-cardinality labels to per-series filtering when a selective equality matcher already narrows the result set. Configured via `-blocks-storage.expanded_postings_cache.head.lazy-matcher-max-cardinality` (disabled by default). #7553
40
+
*[ENHANCEMENT] Ingester: Improve head expanded postings cache hit rate by invalidating only the cache entries whose matched labels changed when a series is created or deleted, instead of invalidating all entries for the metric name. #7678
40
41
*[ENHANCEMENT] Store Gateway: Resolve the parquet shard count from the bucket index instead of reading the converter mark for each block, reducing object storage calls when the bucket index is enabled. A `component` label is added to the bucket index loader metrics to distinguish store-queryable and store-gateway. #7648
41
42
*[ENHANCEMENT] Query Frontend: Improve the slow query log with `source`, `user_agent`, `engine_type`, `block_store_type`, and query stats fields to aid slow query diagnosis. #7601
42
43
*[ENHANCEMENT] Ring: Add ring metric to count number of duplicate tokens. #7626
0 commit comments