Skip to content

Commit 67893aa

Browse files
authored
Remove config options deprecated in Cortex 1.6 (#4101)
* Remove config options deprecated in Cortex 1.6 Signed-off-by: Marco Pracucci <[email protected]> * Marked some features as stable Signed-off-by: Marco Pracucci <[email protected]>
1 parent cf1c444 commit 67893aa

File tree

11 files changed

+14
-120
lines changed

11 files changed

+14
-120
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@
1111
* `-alertmanager.cluster.advertise-address` instead of `-cluster.advertise-address`
1212
* `-alertmanager.cluster.peers` instead of `-cluster.peer`
1313
* `-alertmanager.cluster.peer-timeout` instead of `-cluster.peer-timeout`
14+
* [CHANGE] Blocks storage: removed the config option `-blocks-storage.bucket-store.index-cache.postings-compression-enabled`, which was deprecated in Cortex 1.6. Postings compression is always enabled. #4101
15+
* [CHANGE] Querier: removed the config option `-store.max-look-back-period`, which was deprecated in Cortex 1.6 and was used only by the chunks storage. You should use `-querier.max-query-lookback` instead. #4101
16+
* [CHANGE] Query Frontend: removed the config option `-querier.compress-http-responses`, which was deprecated in Cortex 1.6. You should use`-api.response-compression-enabled` instead. #4101
17+
* [FEATURE] The following features have been marked as stable: #4101
18+
- Shuffle-sharding
19+
- Querier support for querying chunks and blocks store at the same time
20+
- Tracking of active series and exporting them as metrics (`-ingester.active-series-metrics-enabled` and related flags)
21+
- Blocks storage: lazy mmap of block indexes in the store-gateway (`-blocks-storage.bucket-store.index-header-lazy-loading-enabled`)
22+
- Ingester: close idle TSDB and remove them from local disk (`-blocks-storage.tsdb.close-idle-tsdb-timeout`)
1423
* [FEATURE] Memberlist: add TLS configuration options for the memberlist transport layer used by the gossip KV store. #4046
1524
* New flags added for memberlist communication:
1625
* `-memberlist.tls-enabled`

docs/blocks-storage/querier.md

-5
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,6 @@ blocks_storage:
517517
# CLI flag: -blocks-storage.bucket-store.index-cache.memcached.max-item-size
518518
[max_item_size: <int> | default = 1048576]
519519
520-
# Deprecated: compress postings before storing them to postings cache.
521-
# This option is unused and postings compression is always enabled.
522-
# CLI flag: -blocks-storage.bucket-store.index-cache.postings-compression-enabled
523-
[postings_compression_enabled: <boolean> | default = false]
524-
525520
chunks_cache:
526521
# Backend for chunks cache, if not empty. Supported values: memcached.
527522
# CLI flag: -blocks-storage.bucket-store.chunks-cache.backend

docs/blocks-storage/store-gateway.md

-5
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,6 @@ blocks_storage:
563563
# CLI flag: -blocks-storage.bucket-store.index-cache.memcached.max-item-size
564564
[max_item_size: <int> | default = 1048576]
565565
566-
# Deprecated: compress postings before storing them to postings cache.
567-
# This option is unused and postings compression is always enabled.
568-
# CLI flag: -blocks-storage.bucket-store.index-cache.postings-compression-enabled
569-
[postings_compression_enabled: <boolean> | default = false]
570-
571566
chunks_cache:
572567
# Backend for chunks cache, if not empty. Supported values: memcached.
573568
# CLI flag: -blocks-storage.bucket-store.chunks-cache.backend

docs/configuration/config-file-reference.md

-15
Original file line numberDiff line numberDiff line change
@@ -1058,11 +1058,6 @@ grpc_client_config:
10581058
# CLI flag: -frontend.instance-interface-names
10591059
[instance_interface_names: <list of string> | default = [eth0 en0]]
10601060
1061-
# This flag is about to be deprecated. Please use
1062-
# -api.response-compression-enabled instead.
1063-
# CLI flag: -querier.compress-http-responses
1064-
[compress_responses: <boolean> | default = false]
1065-
10661061
# URL of downstream Prometheus.
10671062
# CLI flag: -frontend.downstream-url
10681063
[downstream_url: <string> | default = ""]
@@ -3436,11 +3431,6 @@ write_dedupe_cache_config:
34363431
# Cache index entries older than this period. 0 to disable.
34373432
# CLI flag: -store.cache-lookups-older-than
34383433
[cache_lookups_older_than: <duration> | default = 0s]
3439-
3440-
# Deprecated: use -querier.max-query-lookback instead. Limit how long back data
3441-
# can be queried. This setting applies to chunks storage only.
3442-
# CLI flag: -store.max-look-back-period
3443-
[max_look_back_period: <duration> | default = 0s]
34443434
```
34453435

34463436
### `ingester_client_config`
@@ -4653,11 +4643,6 @@ bucket_store:
46534643
# CLI flag: -blocks-storage.bucket-store.index-cache.memcached.max-item-size
46544644
[max_item_size: <int> | default = 1048576]
46554645
4656-
# Deprecated: compress postings before storing them to postings cache. This
4657-
# option is unused and postings compression is always enabled.
4658-
# CLI flag: -blocks-storage.bucket-store.index-cache.postings-compression-enabled
4659-
[postings_compression_enabled: <boolean> | default = false]
4660-
46614646
chunks_cache:
46624647
# Backend for chunks cache, if not empty. Supported values: memcached.
46634648
# CLI flag: -blocks-storage.bucket-store.chunks-cache.backend

docs/configuration/v1-guarantees.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,21 @@ Currently experimental features are:
4040
- S3 Server Side Encryption (SSE) using KMS (including per-tenant KMS config overrides).
4141
- Azure blob storage.
4242
- Zone awareness based replication.
43-
- Shuffle sharding (both read and write path).
4443
- Ruler API (to PUT rules).
4544
- Alertmanager API
4645
- Memcached client DNS-based service discovery.
4746
- Delete series APIs.
4847
- In-memory (FIFO) and Redis cache.
4948
- gRPC Store.
50-
- Querier support for querying chunks and blocks store at the same time.
51-
- Tracking of active series and exporting them as metrics (`-ingester.active-series-metrics-enabled` and related flags)
52-
- Shuffle-sharding of queriers in the query-frontend (i.e. use of `-frontend.max-queriers-per-tenant` flag with non-zero value).
5349
- TLS configuration in gRPC and HTTP clients.
5450
- TLS configuration in Etcd client.
5551
- Blocksconvert tools
5652
- OpenStack Swift storage support (both in blocks and chunks storage).
5753
- Metric relabeling in the distributor.
5854
- Scalable query-frontend (when using query-scheduler)
5955
- Querying store for series, labels APIs (`-querier.query-store-for-labels-enabled`)
60-
- Blocks storage: lazy mmap of block indexes in the store-gateway (`-blocks-storage.bucket-store.index-header-lazy-loading-enabled`)
6156
- Ingester: do not unregister from ring on shutdown (`-ingester.unregister-on-shutdown=false`)
6257
- Distributor: do not extend writes on unhealthy ingesters (`-distributor.extend-writes=false`)
63-
- Ingester: close idle TSDB and remove them from local disk (`-blocks-storage.tsdb.close-idle-tsdb-timeout`)
6458
- Tenant Deletion in Purger, for blocks storage.
6559
- Query-frontend: query stats tracking (`-frontend.query-stats-enabled`)
6660
- Blocks storage bucket index
@@ -72,5 +66,5 @@ Currently experimental features are:
7266
- HA Tracker: cleanup of old replicas from KV Store.
7367
- Flags for configuring whether blocks-ingester streams samples or chunks are temporary, and will be removed when feature is tested:
7468
- `-ingester.stream-chunks-when-using-blocks` CLI flag
75-
- `ingester_stream_chunks_when_using_blocks` (boolean) field in runtime config file
69+
- `-ingester_stream_chunks_when_using_blocks` (boolean) field in runtime config file
7670
- Instance limits in ingester and distributor

pkg/chunk/aws/s3_storage_client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func (cfg *S3Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) {
103103
f.StringVar(&cfg.SecretAccessKey, prefix+"s3.secret-access-key", "", "AWS Secret Access Key")
104104
f.BoolVar(&cfg.Insecure, prefix+"s3.insecure", false, "Disable https on s3 connection.")
105105

106-
// TODO Remove in Cortex 1.9.0
106+
// TODO Remove in Cortex 1.10.0
107107
f.BoolVar(&cfg.SSEEncryption, prefix+"s3.sse-encryption", false, "Enable AWS Server Side Encryption [Deprecated: Use .sse instead. if s3.sse-encryption is enabled, it assumes .sse.type SSE-S3]")
108108

109109
cfg.SSEConfig.RegisterFlagsWithPrefix(prefix+"s3.sse.", f)

pkg/chunk/chunk_store.go

-17
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/cortexproject/cortex/pkg/chunk/encoding"
2121
"github.com/cortexproject/cortex/pkg/util"
2222
"github.com/cortexproject/cortex/pkg/util/extract"
23-
"github.com/cortexproject/cortex/pkg/util/flagext"
2423
util_log "github.com/cortexproject/cortex/pkg/util/log"
2524
"github.com/cortexproject/cortex/pkg/util/spanlogger"
2625
"github.com/cortexproject/cortex/pkg/util/validation"
@@ -58,9 +57,6 @@ type StoreConfig struct {
5857

5958
CacheLookupsOlderThan model.Duration `yaml:"cache_lookups_older_than"`
6059

61-
// Limits query start time to be greater than now() - MaxLookBackPeriod, if set.
62-
MaxLookBackPeriod model.Duration `yaml:"max_look_back_period"`
63-
6460
// Not visible in yaml because the setting shouldn't be common between ingesters and queriers.
6561
// This exists in case we don't want to cache all the chunks but still want to take advantage of
6662
// ingester chunk write deduplication. But for the queriers we need the full value. So when this option
@@ -78,16 +74,10 @@ func (cfg *StoreConfig) RegisterFlags(f *flag.FlagSet) {
7874
cfg.WriteDedupeCacheConfig.RegisterFlagsWithPrefix("store.index-cache-write.", "Cache config for index entry writing. ", f)
7975

8076
f.Var(&cfg.CacheLookupsOlderThan, "store.cache-lookups-older-than", "Cache index entries older than this period. 0 to disable.")
81-
f.Var(&cfg.MaxLookBackPeriod, "store.max-look-back-period", "Deprecated: use -querier.max-query-lookback instead. Limit how long back data can be queried. This setting applies to chunks storage only.") // To be removed in Cortex 1.8.
8277
}
8378

8479
// Validate validates the store config.
8580
func (cfg *StoreConfig) Validate(logger log.Logger) error {
86-
if cfg.MaxLookBackPeriod > 0 {
87-
flagext.DeprecatedFlagsUsed.Inc()
88-
level.Warn(logger).Log("msg", "running with DEPRECATED flag -store.max-look-back-period, use -querier.max-query-lookback instead.")
89-
}
90-
9181
if err := cfg.ChunkCacheConfig.Validate(); err != nil {
9282
return err
9383
}
@@ -319,13 +309,6 @@ func (c *baseStore) validateQueryTimeRange(ctx context.Context, userID string, f
319309
return true, nil
320310
}
321311

322-
if c.cfg.MaxLookBackPeriod != 0 {
323-
oldestStartTime := model.Now().Add(-time.Duration(c.cfg.MaxLookBackPeriod))
324-
if oldestStartTime.After(*from) {
325-
*from = oldestStartTime
326-
}
327-
}
328-
329312
if through.After(now.Add(5 * time.Minute)) {
330313
// time-span end is in future ... regard as legal
331314
level.Info(log).Log("msg", "adjusting end timerange from future to now", "old_through", through, "new_through", now)

pkg/chunk/chunk_store_test.go

-54
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"github.com/stretchr/testify/assert"
1818
"github.com/stretchr/testify/require"
1919
"github.com/weaveworks/common/test"
20-
"github.com/weaveworks/common/user"
2120

2221
"github.com/cortexproject/cortex/pkg/chunk/cache"
2322
"github.com/cortexproject/cortex/pkg/chunk/encoding"
@@ -783,59 +782,6 @@ func TestChunkStoreError(t *testing.T) {
783782
}
784783
}
785784

786-
func TestStoreMaxLookBack(t *testing.T) {
787-
ctx := user.InjectOrgID(context.Background(), userID)
788-
metric := labels.Labels{
789-
{Name: labels.MetricName, Value: "foo"},
790-
{Name: "bar", Value: "baz"},
791-
}
792-
storeMaker := stores[0]
793-
storeCfg := storeMaker.configFn()
794-
795-
// Creating 2 stores, One with no look back limit and another with 30 Mins look back limit
796-
storeWithoutLookBackLimit := newTestChunkStoreConfig(t, "v9", storeCfg)
797-
defer storeWithoutLookBackLimit.Stop()
798-
799-
storeCfg.MaxLookBackPeriod = model.Duration(30 * time.Minute)
800-
storeWithLookBackLimit := newTestChunkStoreConfig(t, "v9", storeCfg)
801-
defer storeWithLookBackLimit.Stop()
802-
803-
now := model.Now()
804-
805-
// Populating both stores with chunks
806-
fooChunk1 := dummyChunkFor(now, metric)
807-
err := fooChunk1.Encode()
808-
require.NoError(t, err)
809-
err = storeWithoutLookBackLimit.Put(ctx, []Chunk{fooChunk1})
810-
require.NoError(t, err)
811-
err = storeWithLookBackLimit.Put(ctx, []Chunk{fooChunk1})
812-
require.NoError(t, err)
813-
814-
fooChunk2 := dummyChunkFor(now.Add(-time.Hour*1), metric)
815-
err = fooChunk2.Encode()
816-
require.NoError(t, err)
817-
err = storeWithoutLookBackLimit.Put(ctx, []Chunk{fooChunk2})
818-
require.NoError(t, err)
819-
err = storeWithLookBackLimit.Put(ctx, []Chunk{fooChunk2})
820-
require.NoError(t, err)
821-
822-
matchers, err := parser.ParseMetricSelector(`foo{bar="baz"}`)
823-
if err != nil {
824-
t.Fatal(err)
825-
}
826-
827-
// Both the chunks should be returned
828-
chunks, err := storeWithoutLookBackLimit.Get(ctx, userID, now.Add(-time.Hour), now, matchers...)
829-
require.NoError(t, err)
830-
require.Equal(t, 2, len(chunks))
831-
832-
// Single chunk should be returned with newer timestamp
833-
chunks, err = storeWithLookBackLimit.Get(ctx, userID, now.Add(-time.Hour), now, matchers...)
834-
require.NoError(t, err)
835-
require.Equal(t, 1, len(chunks))
836-
require.Equal(t, now, chunks[0].Through)
837-
}
838-
839785
func benchmarkParseIndexEntries(i int64, regex string, b *testing.B) {
840786
b.ReportAllocs()
841787
b.StopTimer()

pkg/cortex/modules.go

-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"os"
99
"time"
1010

11-
"github.com/NYTimes/gziphandler"
1211
"github.com/go-kit/kit/log/level"
1312
"github.com/opentracing-contrib/go-stdlib/nethttp"
1413
"github.com/opentracing/opentracing-go"
@@ -563,10 +562,6 @@ func (t *Cortex) initQueryFrontend() (serv services.Service, err error) {
563562
roundTripper = t.QueryFrontendTripperware(roundTripper)
564563

565564
handler := transport.NewHandler(t.Cfg.Frontend.Handler, roundTripper, util_log.Logger, prometheus.DefaultRegisterer)
566-
if t.Cfg.Frontend.CompressResponses {
567-
handler = gziphandler.GzipHandler(handler)
568-
}
569-
570565
t.API.RegisterQueryFrontendHandler(handler)
571566

572567
if frontendV1 != nil {

pkg/frontend/config.go

-6
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ type CombinedFrontendConfig struct {
2020
FrontendV1 v1.Config `yaml:",inline"`
2121
FrontendV2 v2.Config `yaml:",inline"`
2222

23-
// Deprecated. Replaced with pkg/api/Config.ResponseCompression field.
24-
// TODO: To be removed in Cortex 1.8.
25-
CompressResponses bool `yaml:"compress_responses"`
26-
2723
DownstreamURL string `yaml:"downstream_url"`
2824
}
2925

@@ -32,8 +28,6 @@ func (cfg *CombinedFrontendConfig) RegisterFlags(f *flag.FlagSet) {
3228
cfg.FrontendV1.RegisterFlags(f)
3329
cfg.FrontendV2.RegisterFlags(f)
3430

35-
f.BoolVar(&cfg.CompressResponses, "querier.compress-http-responses", false, "This flag is about to be deprecated. Please use -api.response-compression-enabled instead.")
36-
3731
f.StringVar(&cfg.DownstreamURL, "frontend.downstream-url", "", "URL of downstream Prometheus.")
3832
}
3933

pkg/storage/tsdb/index_cache.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ var (
3737
)
3838

3939
type IndexCacheConfig struct {
40-
Backend string `yaml:"backend"`
41-
InMemory InMemoryIndexCacheConfig `yaml:"inmemory"`
42-
Memcached MemcachedClientConfig `yaml:"memcached"`
43-
PostingsCompression bool `yaml:"postings_compression_enabled"`
40+
Backend string `yaml:"backend"`
41+
InMemory InMemoryIndexCacheConfig `yaml:"inmemory"`
42+
Memcached MemcachedClientConfig `yaml:"memcached"`
4443
}
4544

4645
func (cfg *IndexCacheConfig) RegisterFlags(f *flag.FlagSet) {
@@ -49,7 +48,6 @@ func (cfg *IndexCacheConfig) RegisterFlags(f *flag.FlagSet) {
4948

5049
func (cfg *IndexCacheConfig) RegisterFlagsWithPrefix(f *flag.FlagSet, prefix string) {
5150
f.StringVar(&cfg.Backend, prefix+"backend", IndexCacheBackendDefault, fmt.Sprintf("The index cache backend type. Supported values: %s.", strings.Join(supportedIndexCacheBackends, ", ")))
52-
f.BoolVar(&cfg.PostingsCompression, prefix+"postings-compression-enabled", false, "Deprecated: compress postings before storing them to postings cache. This option is unused and postings compression is always enabled.") // TODO remove in v1.8.0.
5351

5452
cfg.InMemory.RegisterFlagsWithPrefix(f, prefix+"inmemory.")
5553
cfg.Memcached.RegisterFlagsWithPrefix(f, prefix+"memcached.")

0 commit comments

Comments
 (0)