[0.9.1] panic caused by continuous queries
if we select unknown filed, or select tag(no matter known or unknown), influxd will panic :
create database mydb
use mydb
insert field3,host=serverA,region=2 value=10
insert field3,host=serverA,region=2 value=40
insert field3_test value=10
CREATE CONTINUOUS QUERY field3 ON mydb BEGIN SELECT sum(value) AS val,region INTO field3_test FROM field3 GROUP BY time(30m) END
I can repro on 0.9.1 with the steps above. Still trying to find the minimal repro case.
Note that after every panic I have to blow away my data in order to keep it from panicking again on startup when the CQs run.
It's not related to the CQ name being the same identifier as the measurement (field3), or at least that is not the immediate cause. It still panics with a unique name for the CQ.
It's also not related to the CQ writing into a series that has had data manually added (panics whether or not field3_test already exists).
If the CQ is created before the data is inserted there is no panic. Writing in the data after the CQ is created doesn't panic but it also appears that the CQ never generates any data. Creating a new CQ with similar query causes an immediate panic.
Inserting the data and running a direct query rather than making a CQ doesn't cause a panic.
> create database mydb
> use mydb
Using database mydb
> insert field3,host=serverA,region=2 value=40
> insert field3,host=serverA,region=2 value=41
> insert field3,host=serverA,region=2 value=42
> insert field3,host=serverA,region=2 value=43
> insert field3,host=serverA,region=2 value=44
> SELECT sum(value) AS val,region FROM field3 GROUP BY time(5s)
ERR: error parsing query: aggregate functions with GROUP BY time require a WHERE time clause
> SELECT sum(value) AS val,region FROM field3 WHERE time > now() - 10m GROUP BY time(5s)
name: field3
tags: region=2
time val region
---- --- ------
2015-07-10T17:15:15Z
2015-07-10T17:15:20Z
2015-07-10T17:15:25Z
@beckettsean broken CQs can be dropped by temporarily disabling CQs in the config file (under the [continuous_queries] section).
@beckettsean we've dived into code these days, and actually we already fixed several days ago. we planned to send a PR, but we find more problems with CQ. we are fixing these problems and hopefully will be done within next one or two days.
@CrazyJvm glad you were able to address the issue. We'd love to take a look at a pull request if you can share your improvements.
Hey @CrazyJvm - Any possible updates on a pull request? I really need to take advantage of the new CQ in the 0.9.x releases, but seeing all these problems makes me think I need to wait until this issue and a couple more are fixed.
The original CQ that triggered this no longer parses as valid due to the fix for https://github.com/influxdb/influxdb/issues/3407.
In essence, the combination of an aggregation function and a bare value is no longer valid.