-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Subqueries can only perform math on two fields #8848
Comments
When you kill the query, does the influx client return control or does it continue to stall? Basically, can you take two terminals. In one terminal, run the query that's a problem. In the other, kill the query. Does control return to the first terminal or do you still have to kill the program? |
After killing the query, the influx client does not return control but continues to stall. |
Meh, I thought that would happen. The query is still using resources, but I never fixed the task manager to actually say it was a zombie task. There are two separate tangential issues that I'll also see if I can fix. Fixing them won't help you get a running query, but having them broken makes it worse. I'm trying to reproduce this but haven't been able to yet. It works for me on my local machine. Do you have any missing values within the data? Can you run |
This more accurately shows whether or not a query has been killed. Instead of automatically removing it from the query table when it's killed even though goroutines and iterators may still be open, it now marks the process as killed. This should allow us to more accurately determine if a query has been stalled and is still using resources on the server. This is related to #8848, but not directly connected.
This more accurately shows whether or not a query has been killed. Instead of automatically removing it from the query table when it's killed even though goroutines and iterators may still be open, it now marks the process as killed. This should allow us to more accurately determine if a query has been stalled and is still using resources on the server. This is related to #8848, but not directly connected.
Yes, there is missing data. My data arrives asynchronously and often I don't have data for all fields for a given timestamp. Is that an issue? If necessary, I can give you access to the server.
|
Sorry, accidentally closed and didn't realize until now. |
The missing data can be an issue, but I thought that had been fixed. There was an issue where I'll investigate a bit, but the current query doesn't seem to deadlock for me when I remove a value from the inputs. Is there something more to the query like this?
|
I created the following from scratch to simulate the data. I used your query "SELECT * FROM (SELECT f1, f1 + f2 FROM m1)", and it stalls similar to "SELECT sq FROM (SELECT f1+f2+f3 AS sq FROM m1)". What do you whitness when you use the following?
|
Note that this behavior is not experienced should all fields have a value for each timestamp. Furthermore, it is not experienced if some fields do not have a value provided this does not occur for two subsequent timestamps. This query works:
This query crashes the system:
|
The first one is a good reproducer. I'll try out some fixes. |
System info:
InfluxDB shell version 1.3.5
CentOS Linux release 7.3.1611
Steps to reproduce:
Perform the following query from the shell:
SELECT p FROM (SELECT P51 + P55 + P57 AS p FROM L11)
Expected behavior:
The same results as: SELECT P51 + P55 + P57 AS p FROM L11
Actual behavior:
The query runs indefinitely (at least 5 hours) and the shell locks up requiring me to ctrl-z to exit and then kill the query.
Additional info:
My reason to do this is to perform math within an aggregate function using the subquery workaround described by:
https://docs.influxdata.com/influxdb/v1.3/troubleshooting/frequently-asked-questions/#how-do-i-perform-mathematical-operations-within-a-function
https://docs.influxdata.com/influxdb/v1.3/query_language/data_exploration/#subqueries
I am successfully able to perform math on three fields in the main query.
SELECT P51 + P55 + P57 AS p FROM L11
I am successfully able to perform math on two fields in a subquery, and perform an aggregate function on the results.
SELECT p FROM (SELECT P51 + P55 AS p FROM L11)
SELECT mean(p) AS meanp, count(p) AS countp FROM (SELECT P51+P55 AS p FROM L11)
My desired query, however, displays the same behaviour as the query listed under Steps to Reproduce.
SELECT mean(p) AS meanp, count(p) AS countp FROM (SELECT P51 + P55 + P57 AS p FROM L11)
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z opened service service=subscriber
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z Starting monitor system service=monitor
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z 'build' registered for diagnostics monitoring service=monitor
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z 'runtime' registered for diagnostics monitoring service=monitor
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z 'network' registered for diagnostics monitoring service=monitor
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z 'system' registered for diagnostics monitoring service=monitor
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z Starting precreation service with check interval of 10m0s, advance period of 30m0s service=shard-precreation
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z Starting snapshot service service=snapshot
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z Starting continuous query service service=continuous_querier
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z Starting HTTP service service=httpd
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z Authentication enabled:false service=httpd
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z Listening on HTTP:[::]:8086 service=httpd
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z Starting retention policy enforcement service with check interval of 30m0s service=retention
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z Listening for signals
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z Storing statistics in database '_internal' retention policy 'monitor', at interval 10s service=monitor
Sep 19 15:08:49 devserver influxd[45661]: [I] 2017-09-19T15:08:49Z Sending usage statistics to usage.influxdata.com
Sep 19 15:08:52 devserver influxd[45661]: [httpd] 127.0.0.1 - - [19/Sep/2017:15:08:52 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.3.5" 72ac73a0-9d4c-11e7-8001-000000000000 112
Sep 19 15:08:59 devserver influxd[45661]: [I] 2017-09-19T15:08:59Z SHOW DATABASES service=query
Sep 19 15:08:59 devserver influxd[45661]: [httpd] 127.0.0.1 - - [19/Sep/2017:15:08:59 +0000] "POST /query?db=&epoch=ns&q=SHOW+DATABASES HTTP/1.1" 200 170 "-" "InfluxDBShell/1.3.5" 76e86642-9d4c-11e7-8002-000000000000 731
Sep 19 15:09:10 devserver influxd[45661]: [I] 2017-09-19T15:09:10Z SELECT P51 + P55 + P57 AS p FROM greenbean_dl.autogen.L11 service=query
Sep 19 15:09:10 devserver influxd[45661]: [httpd] 127.0.0.1 - - [19/Sep/2017:15:09:10 +0000] "POST /query?chunked=true&db=greenbean_dl&epoch=ns&q=SELECT+P51+%2B+P55+%2B+P57+AS+p+FROM+L11 HTTP/1.1" 200 401085 "-" "InfluxDBShell/1.
Sep 19 15:09:19 devserver influxd[45661]: [I] 2017-09-19T15:09:19Z SELECT p FROM (SELECT P51 + P55 AS p FROM greenbean_dl.autogen.L11) service=query
Sep 19 15:09:19 devserver influxd[45661]: [httpd] 127.0.0.1 - - [19/Sep/2017:15:09:19 +0000] "POST /query?chunked=true&db=greenbean_dl&epoch=ns&q=SELECT+p+FROM+%28SELECT+P51+%2B+P55+AS+p+FROM+L11%29 HTTP/1.1" 200 130435 "-" "Infl
Sep 19 15:09:27 devserver influxd[45661]: [I] 2017-09-19T15:09:27Z SELECT mean(p) AS meanp, count(p) AS countp FROM (SELECT P51 + P55 AS p FROM greenbean_dl.autogen.L11) service=query
Sep 19 15:09:28 devserver influxd[45661]: [httpd] 127.0.0.1 - - [19/Sep/2017:15:09:27 +0000] "POST /query?chunked=true&db=greenbean_dl&epoch=ns&q=SELECT+mean%28p%29+AS+meanp%2C+count%28p%29+AS+countp+FROM+%28SELECT+P51%2BP55+AS+p
Sep 19 15:09:38 devserver influxd[45661]: [I] 2017-09-19T15:09:38Z SELECT p FROM (SELECT P51 + P55 + P57 AS p FROM greenbean_dl.autogen.L11) service=query
Sep 19 15:10:12 devserver influxd[45661]: [httpd] 127.0.0.1 - - [19/Sep/2017:15:10:12 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.3.5" a282518e-9d4c-11e7-8007-000000000000 21
Sep 19 15:10:15 devserver influxd[45661]: [I] 2017-09-19T15:10:15Z SHOW QUERIES service=query
Sep 19 15:10:15 devserver influxd[45661]: [httpd] 127.0.0.1 - - [19/Sep/2017:15:10:15 +0000] "POST /query?chunked=true&db=&epoch=ns&q=show+queries HTTP/1.1" 200 211 "-" "InfluxDBShell/1.3.5" a40b0b4c-9d4c-11e7-8008-000000000000 7
Sep 19 15:10:22 devserver influxd[45661]: [I] 2017-09-19T15:10:22Z KILL QUERY 5 service=query
Sep 19 15:10:22 devserver influxd[45661]: [httpd] 127.0.0.1 - - [19/Sep/2017:15:10:22 +0000] "POST /query?chunked=true&db=&epoch=ns&q=kill+query+5 HTTP/1.1" 200 67 "-" "InfluxDBShell/1.3.5" a81a9319-9d4c-11e7-8009-000000000000 57
Sep 19 15:10:34 devserver influxd[45661]: [httpd] 127.0.0.1 - - [19/Sep/2017:15:10:34 +0000] "POST /query?chunked=true&db=&epoch=ns&q=SELECT+mean%28p%29+AS+meanp%2C+count%28p%29+AS+countp+FROM+%28SELECT+P51+%2B+P55+%2B+P57+AS+p+F
Sep 19 15:10:48 devserver influxd[45661]: [I] 2017-09-19T15:10:48Z SHOW DATABASES service=query
Sep 19 15:10:48 devserver influxd[45661]: [httpd] 127.0.0.1 - - [19/Sep/2017:15:10:48 +0000] "POST /query?db=&epoch=ns&q=SHOW+DATABASES HTTP/1.1" 200 170 "-" "InfluxDBShell/1.3.5" b7bfb677-9d4c-11e7-800b-000000000000 545
Sep 19 15:10:50 devserver influxd[45661]: [I] 2017-09-19T15:10:50Z SELECT mean(p) AS meanp, count(p) AS countp FROM (SELECT P51 + P55 + P57 AS p FROM greenbean_dl.autogen.L11) service=query
Sep 19 15:11:14 devserver influxd[45661]: [httpd] 127.0.0.1 - - [19/Sep/2017:15:11:14 +000
The text was updated successfully, but these errors were encountered: