Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove config options deprecated in Cortex 1.6 #4101

Merged
merged 2 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
* `-alertmanager.cluster.advertise-address` instead of `-cluster.advertise-address`
* `-alertmanager.cluster.peers` instead of `-cluster.peer`
* `-alertmanager.cluster.peer-timeout` instead of `-cluster.peer-timeout`
* [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
* [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
* [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
* [FEATURE] The following features have been marked as stable: #4101
- Shuffle-sharding
- Querier support for querying chunks and blocks store at the same time
- Tracking of active series and exporting them as metrics (`-ingester.active-series-metrics-enabled` and related flags)
- Blocks storage: lazy mmap of block indexes in the store-gateway (`-blocks-storage.bucket-store.index-header-lazy-loading-enabled`)
- Ingester: close idle TSDB and remove them from local disk (`-blocks-storage.tsdb.close-idle-tsdb-timeout`)
* [FEATURE] Memberlist: add TLS configuration options for the memberlist transport layer used by the gossip KV store. #4046
* New flags added for memberlist communication:
* `-memberlist.tls-enabled`
Expand Down
5 changes: 0 additions & 5 deletions docs/blocks-storage/querier.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,6 @@ blocks_storage:
# CLI flag: -blocks-storage.bucket-store.index-cache.memcached.max-item-size
[max_item_size: <int> | default = 1048576]

# Deprecated: compress postings before storing them to postings cache.
# This option is unused and postings compression is always enabled.
# CLI flag: -blocks-storage.bucket-store.index-cache.postings-compression-enabled
[postings_compression_enabled: <boolean> | default = false]

chunks_cache:
# Backend for chunks cache, if not empty. Supported values: memcached.
# CLI flag: -blocks-storage.bucket-store.chunks-cache.backend
Expand Down
5 changes: 0 additions & 5 deletions docs/blocks-storage/store-gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -563,11 +563,6 @@ blocks_storage:
# CLI flag: -blocks-storage.bucket-store.index-cache.memcached.max-item-size
[max_item_size: <int> | default = 1048576]

# Deprecated: compress postings before storing them to postings cache.
# This option is unused and postings compression is always enabled.
# CLI flag: -blocks-storage.bucket-store.index-cache.postings-compression-enabled
[postings_compression_enabled: <boolean> | default = false]

chunks_cache:
# Backend for chunks cache, if not empty. Supported values: memcached.
# CLI flag: -blocks-storage.bucket-store.chunks-cache.backend
Expand Down
15 changes: 0 additions & 15 deletions docs/configuration/config-file-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1058,11 +1058,6 @@ grpc_client_config:
# CLI flag: -frontend.instance-interface-names
[instance_interface_names: <list of string> | default = [eth0 en0]]

# This flag is about to be deprecated. Please use
# -api.response-compression-enabled instead.
# CLI flag: -querier.compress-http-responses
[compress_responses: <boolean> | default = false]

# URL of downstream Prometheus.
# CLI flag: -frontend.downstream-url
[downstream_url: <string> | default = ""]
Expand Down Expand Up @@ -3436,11 +3431,6 @@ write_dedupe_cache_config:
# Cache index entries older than this period. 0 to disable.
# CLI flag: -store.cache-lookups-older-than
[cache_lookups_older_than: <duration> | default = 0s]

# Deprecated: use -querier.max-query-lookback instead. Limit how long back data
# can be queried. This setting applies to chunks storage only.
# CLI flag: -store.max-look-back-period
[max_look_back_period: <duration> | default = 0s]
```

### `ingester_client_config`
Expand Down Expand Up @@ -4653,11 +4643,6 @@ bucket_store:
# CLI flag: -blocks-storage.bucket-store.index-cache.memcached.max-item-size
[max_item_size: <int> | default = 1048576]

# Deprecated: compress postings before storing them to postings cache. This
# option is unused and postings compression is always enabled.
# CLI flag: -blocks-storage.bucket-store.index-cache.postings-compression-enabled
[postings_compression_enabled: <boolean> | default = false]

chunks_cache:
# Backend for chunks cache, if not empty. Supported values: memcached.
# CLI flag: -blocks-storage.bucket-store.chunks-cache.backend
Expand Down
8 changes: 1 addition & 7 deletions docs/configuration/v1-guarantees.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,21 @@ Currently experimental features are:
- S3 Server Side Encryption (SSE) using KMS (including per-tenant KMS config overrides).
- Azure blob storage.
- Zone awareness based replication.
- Shuffle sharding (both read and write path).
- Ruler API (to PUT rules).
- Alertmanager API
- Memcached client DNS-based service discovery.
- Delete series APIs.
- In-memory (FIFO) and Redis cache.
- gRPC Store.
- Querier support for querying chunks and blocks store at the same time.
- Tracking of active series and exporting them as metrics (`-ingester.active-series-metrics-enabled` and related flags)
- Shuffle-sharding of queriers in the query-frontend (i.e. use of `-frontend.max-queriers-per-tenant` flag with non-zero value).
- TLS configuration in gRPC and HTTP clients.
- TLS configuration in Etcd client.
- Blocksconvert tools
- OpenStack Swift storage support (both in blocks and chunks storage).
- Metric relabeling in the distributor.
- Scalable query-frontend (when using query-scheduler)
- Querying store for series, labels APIs (`-querier.query-store-for-labels-enabled`)
- Blocks storage: lazy mmap of block indexes in the store-gateway (`-blocks-storage.bucket-store.index-header-lazy-loading-enabled`)
- Ingester: do not unregister from ring on shutdown (`-ingester.unregister-on-shutdown=false`)
- Distributor: do not extend writes on unhealthy ingesters (`-distributor.extend-writes=false`)
- Ingester: close idle TSDB and remove them from local disk (`-blocks-storage.tsdb.close-idle-tsdb-timeout`)
- Tenant Deletion in Purger, for blocks storage.
- Query-frontend: query stats tracking (`-frontend.query-stats-enabled`)
- Blocks storage bucket index
Expand All @@ -72,5 +66,5 @@ Currently experimental features are:
- HA Tracker: cleanup of old replicas from KV Store.
- Flags for configuring whether blocks-ingester streams samples or chunks are temporary, and will be removed when feature is tested:
- `-ingester.stream-chunks-when-using-blocks` CLI flag
- `ingester_stream_chunks_when_using_blocks` (boolean) field in runtime config file
- `-ingester_stream_chunks_when_using_blocks` (boolean) field in runtime config file
- Instance limits in ingester and distributor
2 changes: 1 addition & 1 deletion pkg/chunk/aws/s3_storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (cfg *S3Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) {
f.StringVar(&cfg.SecretAccessKey, prefix+"s3.secret-access-key", "", "AWS Secret Access Key")
f.BoolVar(&cfg.Insecure, prefix+"s3.insecure", false, "Disable https on s3 connection.")

// TODO Remove in Cortex 1.9.0
// TODO Remove in Cortex 1.10.0
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]")

cfg.SSEConfig.RegisterFlagsWithPrefix(prefix+"s3.sse.", f)
Expand Down
17 changes: 0 additions & 17 deletions pkg/chunk/chunk_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/cortexproject/cortex/pkg/chunk/encoding"
"github.com/cortexproject/cortex/pkg/util"
"github.com/cortexproject/cortex/pkg/util/extract"
"github.com/cortexproject/cortex/pkg/util/flagext"
util_log "github.com/cortexproject/cortex/pkg/util/log"
"github.com/cortexproject/cortex/pkg/util/spanlogger"
"github.com/cortexproject/cortex/pkg/util/validation"
Expand Down Expand Up @@ -58,9 +57,6 @@ type StoreConfig struct {

CacheLookupsOlderThan model.Duration `yaml:"cache_lookups_older_than"`

// Limits query start time to be greater than now() - MaxLookBackPeriod, if set.
MaxLookBackPeriod model.Duration `yaml:"max_look_back_period"`

// Not visible in yaml because the setting shouldn't be common between ingesters and queriers.
// This exists in case we don't want to cache all the chunks but still want to take advantage of
// ingester chunk write deduplication. But for the queriers we need the full value. So when this option
Expand All @@ -78,16 +74,10 @@ func (cfg *StoreConfig) RegisterFlags(f *flag.FlagSet) {
cfg.WriteDedupeCacheConfig.RegisterFlagsWithPrefix("store.index-cache-write.", "Cache config for index entry writing. ", f)

f.Var(&cfg.CacheLookupsOlderThan, "store.cache-lookups-older-than", "Cache index entries older than this period. 0 to disable.")
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.
}

// Validate validates the store config.
func (cfg *StoreConfig) Validate(logger log.Logger) error {
if cfg.MaxLookBackPeriod > 0 {
flagext.DeprecatedFlagsUsed.Inc()
level.Warn(logger).Log("msg", "running with DEPRECATED flag -store.max-look-back-period, use -querier.max-query-lookback instead.")
}

if err := cfg.ChunkCacheConfig.Validate(); err != nil {
return err
}
Expand Down Expand Up @@ -319,13 +309,6 @@ func (c *baseStore) validateQueryTimeRange(ctx context.Context, userID string, f
return true, nil
}

if c.cfg.MaxLookBackPeriod != 0 {
oldestStartTime := model.Now().Add(-time.Duration(c.cfg.MaxLookBackPeriod))
if oldestStartTime.After(*from) {
*from = oldestStartTime
}
}

if through.After(now.Add(5 * time.Minute)) {
// time-span end is in future ... regard as legal
level.Info(log).Log("msg", "adjusting end timerange from future to now", "old_through", through, "new_through", now)
Expand Down
54 changes: 0 additions & 54 deletions pkg/chunk/chunk_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/weaveworks/common/test"
"github.com/weaveworks/common/user"

"github.com/cortexproject/cortex/pkg/chunk/cache"
"github.com/cortexproject/cortex/pkg/chunk/encoding"
Expand Down Expand Up @@ -783,59 +782,6 @@ func TestChunkStoreError(t *testing.T) {
}
}

func TestStoreMaxLookBack(t *testing.T) {
ctx := user.InjectOrgID(context.Background(), userID)
metric := labels.Labels{
{Name: labels.MetricName, Value: "foo"},
{Name: "bar", Value: "baz"},
}
storeMaker := stores[0]
storeCfg := storeMaker.configFn()

// Creating 2 stores, One with no look back limit and another with 30 Mins look back limit
storeWithoutLookBackLimit := newTestChunkStoreConfig(t, "v9", storeCfg)
defer storeWithoutLookBackLimit.Stop()

storeCfg.MaxLookBackPeriod = model.Duration(30 * time.Minute)
storeWithLookBackLimit := newTestChunkStoreConfig(t, "v9", storeCfg)
defer storeWithLookBackLimit.Stop()

now := model.Now()

// Populating both stores with chunks
fooChunk1 := dummyChunkFor(now, metric)
err := fooChunk1.Encode()
require.NoError(t, err)
err = storeWithoutLookBackLimit.Put(ctx, []Chunk{fooChunk1})
require.NoError(t, err)
err = storeWithLookBackLimit.Put(ctx, []Chunk{fooChunk1})
require.NoError(t, err)

fooChunk2 := dummyChunkFor(now.Add(-time.Hour*1), metric)
err = fooChunk2.Encode()
require.NoError(t, err)
err = storeWithoutLookBackLimit.Put(ctx, []Chunk{fooChunk2})
require.NoError(t, err)
err = storeWithLookBackLimit.Put(ctx, []Chunk{fooChunk2})
require.NoError(t, err)

matchers, err := parser.ParseMetricSelector(`foo{bar="baz"}`)
if err != nil {
t.Fatal(err)
}

// Both the chunks should be returned
chunks, err := storeWithoutLookBackLimit.Get(ctx, userID, now.Add(-time.Hour), now, matchers...)
require.NoError(t, err)
require.Equal(t, 2, len(chunks))

// Single chunk should be returned with newer timestamp
chunks, err = storeWithLookBackLimit.Get(ctx, userID, now.Add(-time.Hour), now, matchers...)
require.NoError(t, err)
require.Equal(t, 1, len(chunks))
require.Equal(t, now, chunks[0].Through)
}

func benchmarkParseIndexEntries(i int64, regex string, b *testing.B) {
b.ReportAllocs()
b.StopTimer()
Expand Down
5 changes: 0 additions & 5 deletions pkg/cortex/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"os"
"time"

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

handler := transport.NewHandler(t.Cfg.Frontend.Handler, roundTripper, util_log.Logger, prometheus.DefaultRegisterer)
if t.Cfg.Frontend.CompressResponses {
handler = gziphandler.GzipHandler(handler)
}

t.API.RegisterQueryFrontendHandler(handler)

if frontendV1 != nil {
Expand Down
6 changes: 0 additions & 6 deletions pkg/frontend/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ type CombinedFrontendConfig struct {
FrontendV1 v1.Config `yaml:",inline"`
FrontendV2 v2.Config `yaml:",inline"`

// Deprecated. Replaced with pkg/api/Config.ResponseCompression field.
// TODO: To be removed in Cortex 1.8.
CompressResponses bool `yaml:"compress_responses"`

DownstreamURL string `yaml:"downstream_url"`
}

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

f.BoolVar(&cfg.CompressResponses, "querier.compress-http-responses", false, "This flag is about to be deprecated. Please use -api.response-compression-enabled instead.")

f.StringVar(&cfg.DownstreamURL, "frontend.downstream-url", "", "URL of downstream Prometheus.")
}

Expand Down
8 changes: 3 additions & 5 deletions pkg/storage/tsdb/index_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ var (
)

type IndexCacheConfig struct {
Backend string `yaml:"backend"`
InMemory InMemoryIndexCacheConfig `yaml:"inmemory"`
Memcached MemcachedClientConfig `yaml:"memcached"`
PostingsCompression bool `yaml:"postings_compression_enabled"`
Backend string `yaml:"backend"`
InMemory InMemoryIndexCacheConfig `yaml:"inmemory"`
Memcached MemcachedClientConfig `yaml:"memcached"`
}

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

func (cfg *IndexCacheConfig) RegisterFlagsWithPrefix(f *flag.FlagSet, prefix string) {
f.StringVar(&cfg.Backend, prefix+"backend", IndexCacheBackendDefault, fmt.Sprintf("The index cache backend type. Supported values: %s.", strings.Join(supportedIndexCacheBackends, ", ")))
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.

cfg.InMemory.RegisterFlagsWithPrefix(f, prefix+"inmemory.")
cfg.Memcached.RegisterFlagsWithPrefix(f, prefix+"memcached.")
Expand Down