Skip to content

Commit

Permalink
Remove the deprecated frontend.cache_unaligned_requests YAML config
Browse files Browse the repository at this point in the history
The setting has per-tenant and moved under limits configuration since
Mimir 2.10

See #5312

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
  • Loading branch information
56quarters committed Mar 1, 2024
1 parent b69b4f4 commit d816736
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 9 additions & 20 deletions pkg/frontend/querymiddleware/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand Down
8 changes: 0 additions & 8 deletions pkg/mimir/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d816736

Please sign in to comment.