From d81673671eeb8dd83d35cca93296899d5f01c6c6 Mon Sep 17 00:00:00 2001 From: Nick Pillitteri Date: Fri, 1 Mar 2024 16:28:07 -0500 Subject: [PATCH] Remove the deprecated frontend.cache_unaligned_requests YAML config The setting has per-tenant and moved under limits configuration since Mimir 2.10 See #5312 Signed-off-by: Nick Pillitteri --- CHANGELOG.md | 1 + pkg/frontend/querymiddleware/roundtrip.go | 29 +++++++---------------- pkg/mimir/modules.go | 8 ------- 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f553c5aed9..959685b9d96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ * [CHANGE] Standardise exemplar label as "trace_id". #7475 * [CHANGE] The configuration option `-querier.max-query-into-future` has been deprecated and will be removed in Mimir 2.14. #7496 * [CHANGE] Distributor: the metric `cortex_distributor_sample_delay_seconds` has been deprecated and will be removed in Mimir 2.14. #7516 +* [CHANGE] Query-frontend: The deprecated YAML setting `frontend.cache_unaligned_requests` has been moved to `limits.cache_unaligned_requests`. #7519 * [FEATURE] Introduce `-server.log-source-ips-full` option to log all IPs from `Forwarded`, `X-Real-IP`, `X-Forwarded-For` headers. #7250 * [FEATURE] Introduce `-tenant-federation.max-tenants` option to limit the max number of tenants allowed for requests when federation is enabled. #6959 * [FEATURE] Cardinality API: added a new `count_method` parameter which enables counting active label values. #7085 diff --git a/pkg/frontend/querymiddleware/roundtrip.go b/pkg/frontend/querymiddleware/roundtrip.go index e632876a778..e68c95b898b 100644 --- a/pkg/frontend/querymiddleware/roundtrip.go +++ b/pkg/frontend/querymiddleware/roundtrip.go @@ -36,10 +36,6 @@ const ( cardinalityActiveSeriesPathSuffix = "/api/v1/cardinality/active_series" labelNamesPathSuffix = "/api/v1/labels" - // DefaultDeprecatedCacheUnalignedRequests is the default value for the deprecated querier frontend config DeprecatedCacheUnalignedRequests - // which has been moved to a per-tenant limit; TODO remove in Mimir 2.12 - DefaultDeprecatedCacheUnalignedRequests = false - // DefaultDeprecatedAlignQueriesWithStep is the default value for the deprecated querier frontend config DeprecatedAlignQueriesWithStep // which has been moved to a per-tenant limit; TODO remove in Mimir 2.14 DefaultDeprecatedAlignQueriesWithStep = false @@ -58,16 +54,15 @@ var ( // Config for query_range middleware chain. type Config struct { - SplitQueriesByInterval time.Duration `yaml:"split_queries_by_interval" category:"advanced"` - DeprecatedAlignQueriesWithStep bool `yaml:"align_queries_with_step" doc:"hidden"` // Deprecated: Deprecated in Mimir 2.12, remove in Mimir 2.14 (https://github.com/grafana/mimir/issues/6712) - ResultsCacheConfig `yaml:"results_cache"` - CacheResults bool `yaml:"cache_results"` - MaxRetries int `yaml:"max_retries" category:"advanced"` - NotRunningTimeout time.Duration `yaml:"not_running_timeout" category:"advanced"` - ShardedQueries bool `yaml:"parallelize_shardable_queries"` - DeprecatedCacheUnalignedRequests bool `yaml:"cache_unaligned_requests" category:"advanced" doc:"hidden"` // Deprecated: Deprecated in Mimir 2.10.0, remove in Mimir 2.12.0 (https://github.com/grafana/mimir/issues/5253) - TargetSeriesPerShard uint64 `yaml:"query_sharding_target_series_per_shard" category:"advanced"` - ShardActiveSeriesQueries bool `yaml:"shard_active_series_queries" category:"experimental"` + SplitQueriesByInterval time.Duration `yaml:"split_queries_by_interval" category:"advanced"` + DeprecatedAlignQueriesWithStep bool `yaml:"align_queries_with_step" doc:"hidden"` // Deprecated: Deprecated in Mimir 2.12, remove in Mimir 2.14 (https://github.com/grafana/mimir/issues/6712) + ResultsCacheConfig `yaml:"results_cache"` + CacheResults bool `yaml:"cache_results"` + MaxRetries int `yaml:"max_retries" category:"advanced"` + NotRunningTimeout time.Duration `yaml:"not_running_timeout" category:"advanced"` + ShardedQueries bool `yaml:"parallelize_shardable_queries"` + TargetSeriesPerShard uint64 `yaml:"query_sharding_target_series_per_shard" category:"advanced"` + ShardActiveSeriesQueries bool `yaml:"shard_active_series_queries" category:"experimental"` // CacheKeyGenerator allows to inject a CacheKeyGenerator to use for generating cache keys. // If nil, the querymiddleware package uses a DefaultCacheKeyGenerator with SplitQueriesByInterval. @@ -88,12 +83,6 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) { f.BoolVar(&cfg.ShardActiveSeriesQueries, "query-frontend.shard-active-series-queries", false, "True to enable sharding of active series queries.") cfg.ResultsCacheConfig.RegisterFlags(f) - // The query-frontend.cache-unaligned-requests flag has been moved to the limits.go file - // cfg.DeprecatedCacheUnalignedRequests is set to the default here for clarity - // and consistency with the process for migrating limits to per-tenant config - // TODO: Remove in Mimir 2.12.0 - cfg.DeprecatedCacheUnalignedRequests = DefaultDeprecatedCacheUnalignedRequests - // The query-frontend.align-queries-with-step flag has been moved to the limits.go file // cfg.DeprecatedAlignQueriesWithStep is set to the default here for clarity // and consistency with the process for migrating limits to per-tenant config diff --git a/pkg/mimir/modules.go b/pkg/mimir/modules.go index a3354c10d70..66eef8ff9aa 100644 --- a/pkg/mimir/modules.go +++ b/pkg/mimir/modules.go @@ -385,14 +385,6 @@ func (t *Mimir) initRuntimeConfig() (services.Service, error) { loader := runtimeConfigLoader{validate: t.Cfg.ValidateLimits} t.Cfg.RuntimeConfig.Loader = loader.load - // DeprecatedCacheUnalignedRequests is moving from a global config that can in the frontend yaml to a limit config - // We need to preserve the option in the frontend yaml for two releases - // If the frontend config is configured by the user, the default limit is overwritten - // TODO: Remove in Mimir 2.12.0 - if t.Cfg.Frontend.QueryMiddleware.DeprecatedCacheUnalignedRequests != querymiddleware.DefaultDeprecatedCacheUnalignedRequests { - t.Cfg.LimitsConfig.ResultsCacheForUnalignedQueryEnabled = t.Cfg.Frontend.QueryMiddleware.DeprecatedCacheUnalignedRequests - } - // DeprecatedAlignQueriesWithStep is moving from a global config that can in the frontend yaml to a limit config // We need to preserve the option in the frontend yaml for two releases // If the frontend config is configured by the user, the default limit is overwritten