Skip to content

Commit

Permalink
Remove internal use of store.max-query-length (#4017)
Browse files Browse the repository at this point in the history
Make deprecation of the option more obvious and attempt to remove
any use of store.max-query-length in our documentation, jsonnet, helm,
and integration tests.

See #2793
See #3825

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
  • Loading branch information
56quarters authored Jan 20, 2023
1 parent f639132 commit b35a78a
Show file tree
Hide file tree
Showing 48 changed files with 99 additions and 98 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Grafana Mimir

* [CHANGE] Querier: Introduce `-querier.max-partial-query-length` to limit the time range for partial queries at the querier level and deprecate `-store.max-query-length`. #3825
* [CHANGE] Querier: Introduce `-querier.max-partial-query-length` to limit the time range for partial queries at the querier level and deprecate `-store.max-query-length`. #3825 #4017
* [CHANGE] Store-gateway: Remove experimental `-blocks-storage.bucket-store.max-concurrent-reject-over-limit` flag. #3706
* [CHANGE] Ingester: If shipping is enabled block retention will now be relative to the upload time to cloud storage. If shipping is disabled block retention will be relative to the creation time of the block instead of the mintime of the last block created. #3816
* [CHANGE] Query-frontend: Deprecated CLI flag `-query-frontend.align-querier-with-step` has been removed. #3982
Expand Down
2 changes: 1 addition & 1 deletion cmd/mimir/help-all.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2060,7 +2060,7 @@ Usage of ./cmd/mimir/mimir:
-store.max-labels-query-length duration
Limit the time range (end - start time) of series, label names and values queries. This limit is enforced in the querier. If the requested time range is outside the allowed range, the request will not fail but will be manipulated to only query data within the allowed time range. 0 to disable.
-store.max-query-length duration
Limit the query time range (end - start time). This limit is enforced in the querier (on the query possibly split by the query-frontend) and ruler. 0 to disable.
Deprecated: Limit the query time range (end - start time). This limit is enforced in the querier (on the query possibly split by the query-frontend) and ruler. 0 to disable. This option is deprecated, use -querier.max-partial-query-length or -query-frontend.max-total-query-length instead.
-target comma-separated-list-of-strings
Comma-separated list of components to include in the instantiated process. The default value 'all' includes all components that are required to form a functional Grafana Mimir instance in single-binary mode. Use the '-modules' command line flag to get a list of available components, and to see which components are included with 'all'. (default all)
-tenant-federation.enabled
Expand Down
2 changes: 1 addition & 1 deletion cmd/mimir/help.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ Usage of ./cmd/mimir/mimir:
-store.max-labels-query-length duration
Limit the time range (end - start time) of series, label names and values queries. This limit is enforced in the querier. If the requested time range is outside the allowed range, the request will not fail but will be manipulated to only query data within the allowed time range. 0 to disable.
-store.max-query-length duration
Limit the query time range (end - start time). This limit is enforced in the querier (on the query possibly split by the query-frontend) and ruler. 0 to disable.
Deprecated: Limit the query time range (end - start time). This limit is enforced in the querier (on the query possibly split by the query-frontend) and ruler. 0 to disable. This option is deprecated, use -querier.max-partial-query-length or -query-frontend.max-total-query-length instead.
-target comma-separated-list-of-strings
Comma-separated list of components to include in the instantiated process. The default value 'all' includes all components that are required to form a functional Grafana Mimir instance in single-binary mode. Use the '-modules' command line flag to get a list of available components, and to see which components are included with 'all'. (default all)
-tenant-federation.enabled
Expand Down
4 changes: 2 additions & 2 deletions development/mimir-microservices-mode/docker-compose.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ std.manifestYamlDoc({
httpPort: 8007,
jaegerApp: 'query-frontend',
extraArguments:
'-store.max-query-length=8760h' +
'-query-frontend.max-total-query-length=8760h' +
// Use of scheduler is activated by `-query-frontend.scheduler-address` option.
(if $._config.use_query_scheduler then ' -query-frontend.scheduler-address=query-scheduler:9011' else ''),
}),
Expand All @@ -87,7 +87,7 @@ std.manifestYamlDoc({
'query-scheduler': mimirService({
target: 'query-scheduler',
httpPort: 8011,
extraArguments: '-store.max-query-length=8760h',
extraArguments: '-query-frontend.max-total-query-length=8760h',
}),
} else {}
),
Expand Down
4 changes: 2 additions & 2 deletions development/mimir-microservices-mode/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
"command":
- "sh"
- "-c"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=query-frontend -server.http-listen-port=8007 -server.grpc-listen-port=9007 -activity-tracker.filepath=/activity/query-frontend-8007 -store.max-query-length=8760h -query-frontend.scheduler-address=query-scheduler:9011 -memberlist.nodename=query-frontend -memberlist.bind-port=10007 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=query-frontend -server.http-listen-port=8007 -server.grpc-listen-port=9007 -activity-tracker.filepath=/activity/query-frontend-8007 -query-frontend.max-total-query-length=8760h -query-frontend.scheduler-address=query-scheduler:9011 -memberlist.nodename=query-frontend -memberlist.bind-port=10007 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist"
"depends_on":
- "minio"
- "distributor-1"
Expand All @@ -282,7 +282,7 @@
"command":
- "sh"
- "-c"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=query-scheduler -server.http-listen-port=8011 -server.grpc-listen-port=9011 -activity-tracker.filepath=/activity/query-scheduler-8011 -store.max-query-length=8760h -memberlist.nodename=query-scheduler -memberlist.bind-port=10011 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=query-scheduler -server.http-listen-port=8011 -server.grpc-listen-port=9011 -activity-tracker.filepath=/activity/query-scheduler-8011 -query-frontend.max-total-query-length=8760h -memberlist.nodename=query-scheduler -memberlist.bind-port=10011 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist"
"depends_on":
- "minio"
- "distributor-1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ This time period is what Grafana Mimir calls the _query time range length_ (or _
Mimir has a limit on the query length.
This limit is applied to partial queries, after they've split (according to time) by the query-frontend. This limit protects the system’s stability from potential abuse or mistakes.
To configure the limit on a per-tenant basis, use the `-store.max-query-length` option (or `max_query_length` in the runtime configuration).
To configure the limit on a per-tenant basis, use the `-querier.max-partial-query-length` option (or `max_partial_query_length` in the runtime configuration).
### err-mimir-max-total-query-length
Expand Down
2 changes: 1 addition & 1 deletion integration/query_frontend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@ overrides:

flags = mergeFlags(flags, map[string]string{
"-querier.max-samples": "20", // Very low limit so that we can easily hit it, but high enough to test other features.
"-querier.max-partial-query-length": "30d", // To test too long query error (31d)
"-query-frontend.parallelize-shardable-queries": "true", // Allow queries to be parallized (query-sharding)
"-query-frontend.query-sharding-total-shards": "0", // Disable query-sharding by default
"-store.max-query-length": "30d", // To test too long query error (31d)
"-runtime-config.file": filepath.Join(e2e.ContainerSharedDir, runtimeConfig), // Read per tenant runtime config
})
consul := e2edb.NewConsul()
Expand Down
6 changes: 3 additions & 3 deletions operations/mimir-tests/test-autoscaling-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ spec:
- -memberlist.join=dns+gossip-ring.default.svc.cluster.local:7946
- -querier.frontend-client.grpc-max-send-msg-size=104857600
- -querier.max-concurrent=8
- -querier.max-partial-query-length=768h
- -querier.scheduler-address=query-scheduler-discovery.default.svc.cluster.local:9095
- -runtime-config.file=/etc/mimir/overrides.yaml
- -server.grpc.keepalive.min-time-between-pings=10s
Expand All @@ -578,7 +579,6 @@ spec:
- -store-gateway.sharding-ring.prefix=
- -store-gateway.sharding-ring.replication-factor=3
- -store-gateway.sharding-ring.store=memberlist
- -store.max-query-length=768h
- -target=querier
- -usage-stats.installation-mode=jsonnet
env:
Expand Down Expand Up @@ -796,6 +796,7 @@ spec:
- -ingester.ring.store=memberlist
- -memberlist.bind-port=7946
- -memberlist.join=dns+gossip-ring.default.svc.cluster.local:7946
- -querier.max-partial-query-length=768h
- -ruler-storage.gcs.bucket-name=rules-bucket
- -ruler.alertmanager-url=http://alertmanager.default.svc.cluster.local/alertmanager
- -ruler.max-rule-groups-per-tenant=35
Expand All @@ -810,7 +811,6 @@ spec:
- -store-gateway.sharding-ring.prefix=
- -store-gateway.sharding-ring.replication-factor=3
- -store-gateway.sharding-ring.store=memberlist
- -store.max-query-length=768h
- -target=ruler
- -usage-stats.installation-mode=jsonnet
image: grafana/mimir:2.5.0
Expand Down Expand Up @@ -891,6 +891,7 @@ spec:
- -memberlist.join=dns+gossip-ring.default.svc.cluster.local:7946
- -querier.frontend-client.grpc-max-send-msg-size=104857600
- -querier.max-concurrent=8
- -querier.max-partial-query-length=768h
- -querier.scheduler-address=ruler-query-scheduler-discovery.default.svc.cluster.local:9095
- -runtime-config.file=/etc/mimir/overrides.yaml
- -server.grpc.keepalive.min-time-between-pings=10s
Expand All @@ -899,7 +900,6 @@ spec:
- -store-gateway.sharding-ring.prefix=
- -store-gateway.sharding-ring.replication-factor=3
- -store-gateway.sharding-ring.store=memberlist
- -store.max-query-length=768h
- -target=querier
- -usage-stats.installation-mode=jsonnet
env:
Expand Down
4 changes: 2 additions & 2 deletions operations/mimir-tests/test-consul-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ spec:
- -mem-ballast-size-bytes=268435456
- -querier.frontend-client.grpc-max-send-msg-size=104857600
- -querier.max-concurrent=8
- -querier.max-partial-query-length=768h
- -querier.scheduler-address=query-scheduler-discovery.default.svc.cluster.local:9095
- -runtime-config.file=/etc/mimir/overrides.yaml
- -server.grpc.keepalive.min-time-between-pings=10s
Expand All @@ -871,7 +872,6 @@ spec:
- -store-gateway.sharding-ring.prefix=
- -store-gateway.sharding-ring.replication-factor=3
- -store-gateway.sharding-ring.store=consul
- -store.max-query-length=768h
- -target=querier
- -usage-stats.installation-mode=jsonnet
env:
Expand Down Expand Up @@ -1085,6 +1085,7 @@ spec:
- -ingester.ring.prefix=
- -ingester.ring.replication-factor=3
- -ingester.ring.store=consul
- -querier.max-partial-query-length=768h
- -ruler-storage.gcs.bucket-name=rules-bucket
- -ruler.alertmanager-url=http://alertmanager.default.svc.cluster.local/alertmanager
- -ruler.max-rule-groups-per-tenant=35
Expand All @@ -1100,7 +1101,6 @@ spec:
- -store-gateway.sharding-ring.prefix=
- -store-gateway.sharding-ring.replication-factor=3
- -store-gateway.sharding-ring.store=consul
- -store.max-query-length=768h
- -target=ruler
- -usage-stats.installation-mode=jsonnet
image: grafana/mimir:2.5.0
Expand Down
4 changes: 2 additions & 2 deletions operations/mimir-tests/test-consul-multi-zone-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,7 @@ spec:
- -mem-ballast-size-bytes=268435456
- -querier.frontend-client.grpc-max-send-msg-size=104857600
- -querier.max-concurrent=8
- -querier.max-partial-query-length=768h
- -querier.scheduler-address=query-scheduler-discovery.default.svc.cluster.local:9095
- -runtime-config.file=/etc/mimir/overrides.yaml
- -server.grpc.keepalive.min-time-between-pings=10s
Expand All @@ -1024,7 +1025,6 @@ spec:
- -store-gateway.sharding-ring.replication-factor=3
- -store-gateway.sharding-ring.store=consul
- -store-gateway.sharding-ring.zone-awareness-enabled=true
- -store.max-query-length=768h
- -target=querier
- -usage-stats.installation-mode=jsonnet
env:
Expand Down Expand Up @@ -1284,6 +1284,7 @@ spec:
- -ingester.ring.replication-factor=3
- -ingester.ring.store=consul
- -ingester.ring.zone-awareness-enabled=true
- -querier.max-partial-query-length=768h
- -ruler-storage.gcs.bucket-name=rules-bucket
- -ruler.alertmanager-url=http://alertmanager.default.svc.cluster.local/alertmanager
- -ruler.max-rule-groups-per-tenant=35
Expand All @@ -1300,7 +1301,6 @@ spec:
- -store-gateway.sharding-ring.replication-factor=3
- -store-gateway.sharding-ring.store=consul
- -store-gateway.sharding-ring.zone-awareness-enabled=true
- -store.max-query-length=768h
- -target=ruler
- -usage-stats.installation-mode=jsonnet
image: grafana/mimir:2.5.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ spec:
- -mem-ballast-size-bytes=268435456
- -querier.frontend-client.grpc-max-send-msg-size=104857600
- -querier.max-concurrent=8
- -querier.max-partial-query-length=768h
- -querier.scheduler-address=query-scheduler-discovery.default.svc.cluster.local:9095
- -runtime-config.file=/etc/mimir/overrides.yaml
- -server.grpc.keepalive.min-time-between-pings=10s
Expand All @@ -853,7 +854,6 @@ spec:
- -store-gateway.sharding-ring.prefix=
- -store-gateway.sharding-ring.replication-factor=3
- -store-gateway.sharding-ring.store=consul
- -store.max-query-length=768h
- -target=querier
- -usage-stats.installation-mode=jsonnet
env:
Expand Down
2 changes: 1 addition & 1 deletion operations/mimir-tests/test-defaults-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ spec:
- -memberlist.join=dns+gossip-ring.default.svc.cluster.local:7946
- -querier.frontend-client.grpc-max-send-msg-size=104857600
- -querier.max-concurrent=8
- -querier.max-partial-query-length=768h
- -querier.scheduler-address=query-scheduler-discovery.default.svc.cluster.local:9095
- -runtime-config.file=/etc/mimir/overrides.yaml
- -server.grpc.keepalive.min-time-between-pings=10s
Expand All @@ -449,7 +450,6 @@ spec:
- -store-gateway.sharding-ring.prefix=
- -store-gateway.sharding-ring.replication-factor=3
- -store-gateway.sharding-ring.store=memberlist
- -store.max-query-length=768h
- -target=querier
- -usage-stats.installation-mode=jsonnet
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ spec:
- -memberlist.join=dns+gossip-ring.default.svc.cluster.local:7946
- -querier.frontend-client.grpc-max-send-msg-size=104857600
- -querier.max-concurrent=8
- -querier.max-partial-query-length=768h
- -query-frontend.align-queries-with-step=false
- -query-frontend.cache-results=true
- -query-frontend.max-cache-freshness=10m
Expand All @@ -942,7 +943,6 @@ spec:
- -store-gateway.sharding-ring.replication-factor=3
- -store-gateway.sharding-ring.store=memberlist
- -store-gateway.sharding-ring.zone-awareness-enabled=true
- -store.max-query-length=768h
- -target=read
- -usage-stats.installation-mode=jsonnet
env:
Expand Down Expand Up @@ -1028,6 +1028,7 @@ spec:
- -memberlist.join=dns+gossip-ring.default.svc.cluster.local:7946
- -querier.frontend-client.grpc-max-send-msg-size=104857600
- -querier.max-concurrent=8
- -querier.max-partial-query-length=768h
- -query-scheduler.ring.prefix=
- -query-scheduler.ring.store=memberlist
- -query-scheduler.service-discovery-mode=ring
Expand All @@ -1039,7 +1040,6 @@ spec:
- -store-gateway.sharding-ring.replication-factor=3
- -store-gateway.sharding-ring.store=memberlist
- -store-gateway.sharding-ring.zone-awareness-enabled=true
- -store.max-query-length=768h
- -target=querier
- -usage-stats.installation-mode=jsonnet
env:
Expand Down Expand Up @@ -1318,6 +1318,7 @@ spec:
- -ingester.ring.zone-awareness-enabled=true
- -memberlist.bind-port=7946
- -memberlist.join=dns+gossip-ring.default.svc.cluster.local:7946
- -querier.max-partial-query-length=768h
- -ruler-storage.gcs.bucket-name=rules-bucket
- -ruler.alertmanager-url=http://alertmanager.default.svc.cluster.local/alertmanager
- -ruler.max-rule-groups-per-tenant=35
Expand All @@ -1332,7 +1333,6 @@ spec:
- -store-gateway.sharding-ring.replication-factor=3
- -store-gateway.sharding-ring.store=memberlist
- -store-gateway.sharding-ring.zone-awareness-enabled=true
- -store.max-query-length=768h
- -target=ruler
- -usage-stats.installation-mode=jsonnet
image: grafana/mimir:2.5.0
Expand Down Expand Up @@ -2213,6 +2213,7 @@ spec:
- -ingester.ring.zone-awareness-enabled=true
- -memberlist.bind-port=7946
- -memberlist.join=dns+gossip-ring.default.svc.cluster.local:7946
- -querier.max-partial-query-length=768h
- -query-scheduler.max-outstanding-requests-per-tenant=100
- -query-scheduler.max-used-instances=2
- -query-scheduler.ring.prefix=
Expand All @@ -2237,7 +2238,6 @@ spec:
- -store-gateway.sharding-ring.unregister-on-shutdown=false
- -store-gateway.sharding-ring.wait-stability-min-duration=1m
- -store-gateway.sharding-ring.zone-awareness-enabled=true
- -store.max-query-length=768h
- -target=backend
- -usage-stats.installation-mode=jsonnet
image: grafana/mimir:2.5.0
Expand Down Expand Up @@ -2385,6 +2385,7 @@ spec:
- -ingester.ring.zone-awareness-enabled=true
- -memberlist.bind-port=7946
- -memberlist.join=dns+gossip-ring.default.svc.cluster.local:7946
- -querier.max-partial-query-length=768h
- -query-scheduler.max-outstanding-requests-per-tenant=100
- -query-scheduler.max-used-instances=2
- -query-scheduler.ring.prefix=
Expand All @@ -2409,7 +2410,6 @@ spec:
- -store-gateway.sharding-ring.unregister-on-shutdown=false
- -store-gateway.sharding-ring.wait-stability-min-duration=1m
- -store-gateway.sharding-ring.zone-awareness-enabled=true
- -store.max-query-length=768h
- -target=backend
- -usage-stats.installation-mode=jsonnet
image: grafana/mimir:2.5.0
Expand Down Expand Up @@ -2557,6 +2557,7 @@ spec:
- -ingester.ring.zone-awareness-enabled=true
- -memberlist.bind-port=7946
- -memberlist.join=dns+gossip-ring.default.svc.cluster.local:7946
- -querier.max-partial-query-length=768h
- -query-scheduler.max-outstanding-requests-per-tenant=100
- -query-scheduler.max-used-instances=2
- -query-scheduler.ring.prefix=
Expand All @@ -2581,7 +2582,6 @@ spec:
- -store-gateway.sharding-ring.unregister-on-shutdown=false
- -store-gateway.sharding-ring.wait-stability-min-duration=1m
- -store-gateway.sharding-ring.zone-awareness-enabled=true
- -store.max-query-length=768h
- -target=backend
- -usage-stats.installation-mode=jsonnet
image: grafana/mimir:2.5.0
Expand Down
Loading

0 comments on commit b35a78a

Please sign in to comment.