Skip to content

Commit 41aad71

Browse files
committed
Documenting enabled as first field on the config
Signed-off-by: alanprot <[email protected]>
1 parent d8d226d commit 41aad71

File tree

5 files changed

+19
-30
lines changed

5 files changed

+19
-30
lines changed

docs/blocks-storage/querier.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,10 @@ blocks_storage:
15501550
# compacted blocks.
15511551
expanded_postings_cache:
15521552
head:
1553+
# Whether the postings cache is enabled or not
1554+
# CLI flag: -blocks-storage.expanded_postings_cache.head.enabled
1555+
[enabled: <boolean> | default = false]
1556+
15531557
# Max bytes for postings cache
15541558
# CLI flag: -blocks-storage.expanded_postings_cache.head.max-bytes
15551559
[max_bytes: <int> | default = 10485760]
@@ -1558,20 +1562,16 @@ blocks_storage:
15581562
# CLI flag: -blocks-storage.expanded_postings_cache.head.ttl
15591563
[ttl: <duration> | default = 10m]
15601564

1565+
blocks:
15611566
# Whether the postings cache is enabled or not
1562-
# CLI flag: -blocks-storage.expanded_postings_cache.head.enabled
1567+
# CLI flag: -blocks-storage.expanded_postings_cache.block.enabled
15631568
[enabled: <boolean> | default = false]
15641569

1565-
blocks:
15661570
# Max bytes for postings cache
15671571
# CLI flag: -blocks-storage.expanded_postings_cache.block.max-bytes
15681572
[max_bytes: <int> | default = 10485760]
15691573

15701574
# TTL for postings cache
15711575
# CLI flag: -blocks-storage.expanded_postings_cache.block.ttl
15721576
[ttl: <duration> | default = 10m]
1573-
1574-
# Whether the postings cache is enabled or not
1575-
# CLI flag: -blocks-storage.expanded_postings_cache.block.enabled
1576-
[enabled: <boolean> | default = false]
15771577
```

docs/blocks-storage/store-gateway.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,10 @@ blocks_storage:
16411641
# compacted blocks.
16421642
expanded_postings_cache:
16431643
head:
1644+
# Whether the postings cache is enabled or not
1645+
# CLI flag: -blocks-storage.expanded_postings_cache.head.enabled
1646+
[enabled: <boolean> | default = false]
1647+
16441648
# Max bytes for postings cache
16451649
# CLI flag: -blocks-storage.expanded_postings_cache.head.max-bytes
16461650
[max_bytes: <int> | default = 10485760]
@@ -1649,20 +1653,16 @@ blocks_storage:
16491653
# CLI flag: -blocks-storage.expanded_postings_cache.head.ttl
16501654
[ttl: <duration> | default = 10m]
16511655

1656+
blocks:
16521657
# Whether the postings cache is enabled or not
1653-
# CLI flag: -blocks-storage.expanded_postings_cache.head.enabled
1658+
# CLI flag: -blocks-storage.expanded_postings_cache.block.enabled
16541659
[enabled: <boolean> | default = false]
16551660

1656-
blocks:
16571661
# Max bytes for postings cache
16581662
# CLI flag: -blocks-storage.expanded_postings_cache.block.max-bytes
16591663
[max_bytes: <int> | default = 10485760]
16601664

16611665
# TTL for postings cache
16621666
# CLI flag: -blocks-storage.expanded_postings_cache.block.ttl
16631667
[ttl: <duration> | default = 10m]
1664-
1665-
# Whether the postings cache is enabled or not
1666-
# CLI flag: -blocks-storage.expanded_postings_cache.block.enabled
1667-
[enabled: <boolean> | default = false]
16681668
```

docs/configuration/config-file-reference.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,6 +2087,10 @@ tsdb:
20872087
# compacted blocks.
20882088
expanded_postings_cache:
20892089
head:
2090+
# Whether the postings cache is enabled or not
2091+
# CLI flag: -blocks-storage.expanded_postings_cache.head.enabled
2092+
[enabled: <boolean> | default = false]
2093+
20902094
# Max bytes for postings cache
20912095
# CLI flag: -blocks-storage.expanded_postings_cache.head.max-bytes
20922096
[max_bytes: <int> | default = 10485760]
@@ -2095,22 +2099,18 @@ tsdb:
20952099
# CLI flag: -blocks-storage.expanded_postings_cache.head.ttl
20962100
[ttl: <duration> | default = 10m]
20972101

2102+
blocks:
20982103
# Whether the postings cache is enabled or not
2099-
# CLI flag: -blocks-storage.expanded_postings_cache.head.enabled
2104+
# CLI flag: -blocks-storage.expanded_postings_cache.block.enabled
21002105
[enabled: <boolean> | default = false]
21012106

2102-
blocks:
21032107
# Max bytes for postings cache
21042108
# CLI flag: -blocks-storage.expanded_postings_cache.block.max-bytes
21052109
[max_bytes: <int> | default = 10485760]
21062110

21072111
# TTL for postings cache
21082112
# CLI flag: -blocks-storage.expanded_postings_cache.block.ttl
21092113
[ttl: <duration> | default = 10m]
2110-
2111-
# Whether the postings cache is enabled or not
2112-
# CLI flag: -blocks-storage.expanded_postings_cache.block.enabled
2113-
[enabled: <boolean> | default = false]
21142114
```
21152115
21162116
### `compactor_config`

pkg/storage/tsdb/expanded_postings_cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ type TSDBPostingsCacheConfig struct {
6767
}
6868

6969
type PostingsCacheConfig struct {
70+
Enabled bool `yaml:"enabled"`
7071
MaxBytes int64 `yaml:"max_bytes"`
7172
Ttl time.Duration `yaml:"ttl"`
72-
Enabled bool `yaml:"enabled"`
7373
}
7474

7575
func (cfg *TSDBPostingsCacheConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) {

pkg/storage/tsdb/expanded_postings_cache_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,9 @@ func TestFifoCacheExpire(t *testing.T) {
3737
expectedFinalItems int
3838
ttlExpire bool
3939
}{
40-
"MaxItems": {
41-
expectedFinalItems: 3,
42-
cfg: PostingsCacheConfig{
43-
MaxItems: 3,
44-
Enabled: true,
45-
Ttl: time.Hour,
46-
MaxBytes: 10 << 20,
47-
},
48-
},
4940
"MaxBytes": {
5041
expectedFinalItems: 10,
5142
cfg: PostingsCacheConfig{
52-
MaxItems: 10 << 20,
5343
Enabled: true,
5444
Ttl: time.Hour,
5545
MaxBytes: int64(10 * (8 + keySize)),
@@ -59,7 +49,6 @@ func TestFifoCacheExpire(t *testing.T) {
5949
expectedFinalItems: numberOfKeys,
6050
ttlExpire: true,
6151
cfg: PostingsCacheConfig{
62-
MaxItems: 10 << 20,
6352
Enabled: true,
6453
Ttl: time.Hour,
6554
MaxBytes: 10 << 20,

0 commit comments

Comments
 (0)