Skip to content

Commit be467a7

Browse files
committed
Fix fuzzy test after change the flag name
Signed-off-by: alanprot <[email protected]>
1 parent c153cb1 commit be467a7

File tree

7 files changed

+54
-44
lines changed

7 files changed

+54
-44
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* [ENHANCEMENT] Ingester: Add matchers to ingester LabelNames() and LabelNamesStream() RPC. #6209
2727
* [ENHANCEMENT] Ingester/Store Gateway Clients: Introduce an experimental HealthCheck handler to quickly fail requests directed to unhealthy targets. #6225 #6257
2828
* [ENHANCEMENT] Upgrade build image and Go version to 1.23.2. #6261 #6262
29+
* [ENHANCEMENT] Ingester: Introduce a new experimental feature for caching expanded postings on the ingester. #6296
2930
* [ENHANCEMENT] Querier/Ruler: Expose `store_gateway_consistency_check_max_attempts` for max retries when querying store gateway in consistency check. #6276
3031
* [ENHANCEMENT] StoreGateway: Add new `cortex_bucket_store_chunk_pool_inuse_bytes` metric to track the usage in chunk pool. #6310
3132
* [BUGFIX] Runtime-config: Handle absolute file paths when working directory is not / #6224

docs/blocks-storage/querier.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,38 +1545,41 @@ blocks_storage:
15451545
# CLI flag: -blocks-storage.tsdb.enable-native-histograms
15461546
[enable_native_histograms: <boolean> | default = false]
15471547

1548-
postings_cache:
1548+
# [EXPERIMENTAL] If enabled, ingesters will cache expanded postings when
1549+
# querying blocks. Caching can be configured separately for the head and
1550+
# compacted blocks.
1551+
expanded_postings_cache:
15491552
head:
15501553
# Max bytes for postings cache
1551-
# CLI flag: -blocks-storage.postings-cache.head.max-bytes
1554+
# CLI flag: -blocks-storage.expanded_postings_cache.head.max-bytes
15521555
[max_bytes: <int> | default = 10485760]
15531556

15541557
# Max items for postings cache
1555-
# CLI flag: -blocks-storage.postings-cache.head.max-items
1558+
# CLI flag: -blocks-storage.expanded_postings_cache.head.max-items
15561559
[max_items: <int> | default = 10000]
15571560

15581561
# TTL for postings cache
1559-
# CLI flag: -blocks-storage.postings-cache.head.ttl
1562+
# CLI flag: -blocks-storage.expanded_postings_cache.head.ttl
15601563
[ttl: <duration> | default = 10m]
15611564

15621565
# Whether the postings cache is enabled or not
1563-
# CLI flag: -blocks-storage.postings-cache.head.enabled
1566+
# CLI flag: -blocks-storage.expanded_postings_cache.head.enabled
15641567
[enabled: <boolean> | default = false]
15651568

15661569
blocks:
15671570
# Max bytes for postings cache
1568-
# CLI flag: -blocks-storage.postings-cache.block.max-bytes
1571+
# CLI flag: -blocks-storage.expanded_postings_cache.block.max-bytes
15691572
[max_bytes: <int> | default = 10485760]
15701573

15711574
# Max items for postings cache
1572-
# CLI flag: -blocks-storage.postings-cache.block.max-items
1575+
# CLI flag: -blocks-storage.expanded_postings_cache.block.max-items
15731576
[max_items: <int> | default = 10000]
15741577

15751578
# TTL for postings cache
1576-
# CLI flag: -blocks-storage.postings-cache.block.ttl
1579+
# CLI flag: -blocks-storage.expanded_postings_cache.block.ttl
15771580
[ttl: <duration> | default = 10m]
15781581

15791582
# Whether the postings cache is enabled or not
1580-
# CLI flag: -blocks-storage.postings-cache.block.enabled
1583+
# CLI flag: -blocks-storage.expanded_postings_cache.block.enabled
15811584
[enabled: <boolean> | default = false]
15821585
```

docs/blocks-storage/store-gateway.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,38 +1636,41 @@ blocks_storage:
16361636
# CLI flag: -blocks-storage.tsdb.enable-native-histograms
16371637
[enable_native_histograms: <boolean> | default = false]
16381638

1639-
postings_cache:
1639+
# [EXPERIMENTAL] If enabled, ingesters will cache expanded postings when
1640+
# querying blocks. Caching can be configured separately for the head and
1641+
# compacted blocks.
1642+
expanded_postings_cache:
16401643
head:
16411644
# Max bytes for postings cache
1642-
# CLI flag: -blocks-storage.postings-cache.head.max-bytes
1645+
# CLI flag: -blocks-storage.expanded_postings_cache.head.max-bytes
16431646
[max_bytes: <int> | default = 10485760]
16441647

16451648
# Max items for postings cache
1646-
# CLI flag: -blocks-storage.postings-cache.head.max-items
1649+
# CLI flag: -blocks-storage.expanded_postings_cache.head.max-items
16471650
[max_items: <int> | default = 10000]
16481651

16491652
# TTL for postings cache
1650-
# CLI flag: -blocks-storage.postings-cache.head.ttl
1653+
# CLI flag: -blocks-storage.expanded_postings_cache.head.ttl
16511654
[ttl: <duration> | default = 10m]
16521655

16531656
# Whether the postings cache is enabled or not
1654-
# CLI flag: -blocks-storage.postings-cache.head.enabled
1657+
# CLI flag: -blocks-storage.expanded_postings_cache.head.enabled
16551658
[enabled: <boolean> | default = false]
16561659

16571660
blocks:
16581661
# Max bytes for postings cache
1659-
# CLI flag: -blocks-storage.postings-cache.block.max-bytes
1662+
# CLI flag: -blocks-storage.expanded_postings_cache.block.max-bytes
16601663
[max_bytes: <int> | default = 10485760]
16611664

16621665
# Max items for postings cache
1663-
# CLI flag: -blocks-storage.postings-cache.block.max-items
1666+
# CLI flag: -blocks-storage.expanded_postings_cache.block.max-items
16641667
[max_items: <int> | default = 10000]
16651668

16661669
# TTL for postings cache
1667-
# CLI flag: -blocks-storage.postings-cache.block.ttl
1670+
# CLI flag: -blocks-storage.expanded_postings_cache.block.ttl
16681671
[ttl: <duration> | default = 10m]
16691672

16701673
# Whether the postings cache is enabled or not
1671-
# CLI flag: -blocks-storage.postings-cache.block.enabled
1674+
# CLI flag: -blocks-storage.expanded_postings_cache.block.enabled
16721675
[enabled: <boolean> | default = false]
16731676
```

docs/configuration/config-file-reference.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,39 +2082,42 @@ tsdb:
20822082
# CLI flag: -blocks-storage.tsdb.enable-native-histograms
20832083
[enable_native_histograms: <boolean> | default = false]
20842084

2085-
postings_cache:
2085+
# [EXPERIMENTAL] If enabled, ingesters will cache expanded postings when
2086+
# querying blocks. Caching can be configured separately for the head and
2087+
# compacted blocks.
2088+
expanded_postings_cache:
20862089
head:
20872090
# Max bytes for postings cache
2088-
# CLI flag: -blocks-storage.postings-cache.head.max-bytes
2091+
# CLI flag: -blocks-storage.expanded_postings_cache.head.max-bytes
20892092
[max_bytes: <int> | default = 10485760]
20902093

20912094
# Max items for postings cache
2092-
# CLI flag: -blocks-storage.postings-cache.head.max-items
2095+
# CLI flag: -blocks-storage.expanded_postings_cache.head.max-items
20932096
[max_items: <int> | default = 10000]
20942097

20952098
# TTL for postings cache
2096-
# CLI flag: -blocks-storage.postings-cache.head.ttl
2099+
# CLI flag: -blocks-storage.expanded_postings_cache.head.ttl
20972100
[ttl: <duration> | default = 10m]
20982101

20992102
# Whether the postings cache is enabled or not
2100-
# CLI flag: -blocks-storage.postings-cache.head.enabled
2103+
# CLI flag: -blocks-storage.expanded_postings_cache.head.enabled
21012104
[enabled: <boolean> | default = false]
21022105

21032106
blocks:
21042107
# Max bytes for postings cache
2105-
# CLI flag: -blocks-storage.postings-cache.block.max-bytes
2108+
# CLI flag: -blocks-storage.expanded_postings_cache.block.max-bytes
21062109
[max_bytes: <int> | default = 10485760]
21072110

21082111
# Max items for postings cache
2109-
# CLI flag: -blocks-storage.postings-cache.block.max-items
2112+
# CLI flag: -blocks-storage.expanded_postings_cache.block.max-items
21102113
[max_items: <int> | default = 10000]
21112114

21122115
# TTL for postings cache
2113-
# CLI flag: -blocks-storage.postings-cache.block.ttl
2116+
# CLI flag: -blocks-storage.expanded_postings_cache.block.ttl
21142117
[ttl: <duration> | default = 10m]
21152118

21162119
# Whether the postings cache is enabled or not
2117-
# CLI flag: -blocks-storage.postings-cache.block.enabled
2120+
# CLI flag: -blocks-storage.expanded_postings_cache.block.enabled
21182121
[enabled: <boolean> | default = false]
21192122
```
21202123

integration/query_fuzz_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,18 @@ func TestExpandedPostingsCacheFuzz(t *testing.T) {
243243
flags2 := mergeFlags(
244244
AlertmanagerLocalFlags(),
245245
map[string]string{
246-
"-store.engine": blocksStorageEngine,
247-
"-blocks-storage.backend": "filesystem",
248-
"-blocks-storage.tsdb.head-compaction-interval": "4m",
249-
"-blocks-storage.tsdb.block-ranges-period": "2h",
250-
"-blocks-storage.tsdb.ship-interval": "1h",
251-
"-blocks-storage.bucket-store.sync-interval": "15m",
252-
"-blocks-storage.tsdb.retention-period": "2h",
253-
"-blocks-storage.bucket-store.index-cache.backend": tsdb.IndexCacheBackendInMemory,
254-
"-blocks-storage.bucket-store.bucket-index.enabled": "true",
255-
"-querier.query-store-for-labels-enabled": "true",
256-
"-blocks-storage.postings-cache.head.enabled": "true",
257-
"-blocks-storage.postings-cache.block.enabled": "true",
246+
"-store.engine": blocksStorageEngine,
247+
"-blocks-storage.backend": "filesystem",
248+
"-blocks-storage.tsdb.head-compaction-interval": "4m",
249+
"-blocks-storage.tsdb.block-ranges-period": "2h",
250+
"-blocks-storage.tsdb.ship-interval": "1h",
251+
"-blocks-storage.bucket-store.sync-interval": "15m",
252+
"-blocks-storage.tsdb.retention-period": "2h",
253+
"-blocks-storage.bucket-store.index-cache.backend": tsdb.IndexCacheBackendInMemory,
254+
"-blocks-storage.bucket-store.bucket-index.enabled": "true",
255+
"-querier.query-store-for-labels-enabled": "true",
256+
"-blocks-storage.expanded_postings_cache.head.enabled": "true",
257+
"-blocks-storage.expanded_postings_cache.block.enabled": "true",
258258
// Ingester.
259259
"-ring.store": "consul",
260260
"-consul.hostname": consul2.NetworkHTTPEndpoint(),

pkg/storage/tsdb/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ type TSDBConfig struct {
168168
EnableNativeHistograms bool `yaml:"enable_native_histograms"`
169169

170170
// Posting Cache Configuration for TSDB
171-
PostingsCache TSDBPostingsCacheConfig `yaml:"postings_cache"`
171+
PostingsCache TSDBPostingsCacheConfig `yaml:"expanded_postings_cache" doc:"description=[EXPERIMENTAL] If enabled, ingesters will cache expanded postings when querying blocks. Caching can be configured separately for the head and compacted blocks."`
172172
}
173173

174174
// RegisterFlags registers the TSDBConfig flags.

pkg/storage/tsdb/expanded_postings_cache.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ func (cfg *TSDBPostingsCacheConfig) RegisterFlagsWithPrefix(prefix string, f *fl
8080

8181
// RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet
8282
func (cfg *PostingsCacheConfig) RegisterFlagsWithPrefix(prefix, block string, f *flag.FlagSet) {
83-
f.Int64Var(&cfg.MaxBytes, prefix+"postings-cache."+block+".max-bytes", 10*1024*1024, "Max bytes for postings cache")
84-
f.IntVar(&cfg.MaxItems, prefix+"postings-cache."+block+".max-items", 10000, "Max items for postings cache")
85-
f.DurationVar(&cfg.Ttl, prefix+"postings-cache."+block+".ttl", 10*time.Minute, "TTL for postings cache")
86-
f.BoolVar(&cfg.Enabled, prefix+"postings-cache."+block+".enabled", false, "Whether the postings cache is enabled or not")
83+
f.Int64Var(&cfg.MaxBytes, prefix+"expanded_postings_cache."+block+".max-bytes", 10*1024*1024, "Max bytes for postings cache")
84+
f.IntVar(&cfg.MaxItems, prefix+"expanded_postings_cache."+block+".max-items", 10000, "Max items for postings cache")
85+
f.DurationVar(&cfg.Ttl, prefix+"expanded_postings_cache."+block+".ttl", 10*time.Minute, "TTL for postings cache")
86+
f.BoolVar(&cfg.Enabled, prefix+"expanded_postings_cache."+block+".enabled", false, "Whether the postings cache is enabled or not")
8787
}
8888

8989
type ExpandedPostingsCache interface {

0 commit comments

Comments
 (0)