influxdata / influxdata/influxdb

Abort on max-select-buckets not fully working

Open
#16,603 0 comments 0 reactions 0 assignees View on GitHub
1.x
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

__Steps to reproduce:__
List the minimal actions needed to reproduce the behavior.

1. Restrict the query execution by the "max-select-*" parameters:

verfied by `show diagnostics`
...
```
name: config-coordinator
log-queries-after max-concurrent-queries max-select-buckets max-select-point max-select-series query-timeout write-timeout
----------------- ---------------------- ------------------ ---------------- ----------------- ------------- -------------
0s 0 200 0 20 0s 10s
```
2. Execute a query with group by time filtering on one series, but without time interval restriction. E.g.

select count(*) from "project:memory_usage:request" WHERE ("container" = 'hitool') group by time(15s)

__Expected behavior:__

I expect only an error message. In influx command line it should look like
"ERR: max-select-buckets limit exceeded: (721/200)"

And the http api query response should look like:
```
{"JSON":{"results":[{"statement_id":0,"error":"max-select-buckets limit exceeded: (721/200)"}]}
```

e.g. for the following queries the "max-.." config parameters work correctly regarding the returned result:
```
> SELECT mean("value") FROM "project:memory_usage:request" WHERE ("container" = 'hitool') AND time >= now() - 3h GROUP BY time(15s), "job" fill(none)
ERR: max-select-buckets limit exceeded: (721/200)
```

```
> select count(*) from "project:memory_usage:request" group by time(15s), job
ERR: max-select-series limit exceeded: (21/20)
```

__Actual behavior:__

The query returns value rows.
Also no hint on limit as "partial":true like e.g. for max-row-limit parameter return via HTTP.

__Environment info:__

* System info:
docker-image influxdb:1.7.9-alpine

* InfluxDB version:
1.7.9

__Config:__
Copy any non-default config values here or attach the full config as a gist or file.

Only "max-select-*" special set:

```
show diagnostics
...
name: config-coordinator
log-queries-after max-concurrent-queries max-select-buckets max-select-point max-select-series query-timeout write-timeout
----------------- ---------------------- ------------------ ---------------- ----------------- ------------- -------------
0s 0 200 0 20 0s 10s
```

__Logs:__

```
ts=2020-01-21T14:00:26.175935Z lvl=info msg="Executing query" log_id=0KU6CfEW000 service=query query="SELECT mean(value) FROM prom.autogen.\"project:memory_usage:request\" WHERE (container = 'hitool') AND time >= now() - 3h GROUP BY time(15s), job fill(none)"
[httpd] 10.23.15.11,10.130.2.1 - admin [21/Jan/2020:14:00:26 +0000] "POST /query?chunked=true&db=prom&q=SELECT+mean%28%22value%22%29+FROM+%22project%3Amemory_usage%3Arequest%22+WHERE+%28%22container%22+%3D+%27hitool%27%29+AND+time+%3E%3D+now%28%29+-+3h+GROUP+BY+time%2815s%29%2C+%22job%22+fill%28none%29 HTTP/1.1" 200 110 "-" "InfluxDBShell/1.7.9" 5fe28599-3c56-11ea-804e-0a580a830205 628

--

ts=2020-01-21T14:01:27.561859Z lvl=info msg="Executing query" log_id=0KU6CfEW000 service=query query="SELECT count(*) FROM prom.autogen.\"project:memory_usage:request\" GROUP BY time(15s)"
[httpd] 10.23.15.11,10.131.2.1 - admin [21/Jan/2020:14:01:27 +0000] "POST /query?chunked=true&db=prom&q=select+count%28%2A%29+from+%22project%3Amemory_usage%3Arequest%22+group+by+time%2815s%29 HTTP/1.1" 200 105 "-" "InfluxDBShell/1.7.9" 8479487c-3c56-11ea-8065-0a580a830205 807
--
```

__Performance:__

not relevant

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue using the InfluxDB 1.7.9 Docker image, the shown max-select-* settings, and the example query; compare the CLI and HTTP API responses. The work is done when exceeding max-select-buckets returns the expected error rather than rows, with the appropriate HTTP response behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.