influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

[0.9.0] & [0.9.1] Empty continuous queries

Open vptheron opened this issue 11 years ago • 15 comments

Connected to http://localhost:8086 version FIXME
InfluxDB shell 0.9.0
> create database my_db
> use my_db
Using database my_db
> {my_db BEGIN SELECT sum(value) INTO "response_times.sum.5s" FROM response_times WHERE time > now() - 1d GROUP BY time(5s) END
> INSERT response_times value=5
> INSERT response_times value=10
> INSERT response_times value=15
> INSERT response_times value=8
> select * from response_times
name: response_times
--------------------
time                value
2015-07-02T20:14:43.844264226Z  5
2015-07-02T20:14:50.395164835Z  10
2015-07-02T20:14:55.507069156Z  15
2015-07-02T20:14:59.402881586Z  8

> select * from "response_times.sum.5s"
ERR: measurement not found: "my_db"."default"."response_times.sum.5s" 
> show continuous queries
name: my_db
-----------
name    query
my_cq   SELECT sum(value) INTO "my_db"."default"."response_times.sum.5s" FROM "my_db"."default".response_times WHERE time > now() - 1d GROUP BY time(5s)

Am I doing anything wrong here?

Note that I have tried inserting the points first and then creating the continuous query, I have waited 5 seconds (and more) before querying to leave the time to generate the data point.

vptheron avatar Jul 02 '15 20:07 vptheron

@vptheron run show measurements in the CLI and send me the output.

desa avatar Jul 02 '15 20:07 desa

I'm not sure if you are doing anything wrong but I am experiencing the same thing.

Asked the question here: https://groups.google.com/forum/#!topic/influxdb/W6vsebcY3_c

It would be nice is a continuous query showed up as a measurement when it's created successfully.

kevinsteger avatar Jul 05 '15 21:07 kevinsteger

@mjdesa Sorry, I already upgraded to 0.9.1 before seeing your message.

vptheron avatar Jul 06 '15 12:07 vptheron

@mjdesa Actually, the problem persist even in 0.9.1, so here is more logs:

> create database my_db
> use my_db
Using database my_db
> insert response_times value=5
> insert response_times value=10
> insert response_times value=10
> insert response_times value=12
> insert response_times value=18
> 
> CREATE CONTINUOUS QUERY response_times_sum ON my_db BEGIN SELECT sum(value) INTO response_times_sum_5s FROM response_times GROUP BY time(5s) END
> 
> insert response_times value=4
> insert response_times value=42
> 
> select * from response_times
name: response_times
--------------------
time                value
2015-07-06T13:14:21.636510607Z  5
2015-07-06T13:14:25.708174992Z  10
2015-07-06T13:14:26.252080529Z  10
2015-07-06T13:14:28.364009266Z  12
2015-07-06T13:14:35.241871328Z  18
2015-07-06T13:15:26.929973644Z  4
2015-07-06T13:15:34.722995498Z  42

> select * from response_times_sum_5s
ERR: measurement not found: "my_db"."default".response_times_sum_5s
> 
> show measurements
name: measurements
------------------
name
response_times

> 

More details: I run 0.9.1 on Mac OS 10.10.3, I installed Influx via Homebrew and I just start the sever with influx relying on the default config.

vptheron avatar Jul 06 '15 13:07 vptheron

Some progress: if I create the continuous query with AS it works:

CREATE CONTINUOUS QUERY response_times_sum ON my_db BEGIN SELECT sum(value) AS value INTO response_times_sum_5s FROM response_times GROUP BY time(5s) END

Not sure if this is expected behavior, but if so it should be documented properly. The example in the doc at https://influxdb.com/docs/v0.9/query_language/continuous_queries.html does not specify AS.

vptheron avatar Jul 06 '15 14:07 vptheron

When I have no databases already created in InfluxDB and then create my first database, insert data and create a continuous query, it works

However, if I already have some databases created in InfluxDB, the same procedure fails.

sartaj10 avatar Jul 07 '15 18:07 sartaj10

The same issue is here.

> select * from some_test
name: some_test
tags: mytag=machine_name
time                value
----                -----
2015-07-08T11:52:55.437524612Z  0.5
2015-07-08T11:52:58.53333458Z   0.3
2015-07-08T11:53:01.034268781Z  0.4
2015-07-08T11:53:04.484496696Z  0.6
2015-07-08T11:53:06.589100619Z  0.5
> CREATE CONTINUOUS QUERY test_count ON test BEGIN SELECT COUNT(value) as value INTO "test_count" FROM some_test GROUP BY time(1s) END
> show measurements
name: measurements
------------------
name
some_test
> select * from test_count
ERR: measurement not found: "test"."default".test_count

Tested on Mac OS 10.10.4, installed using brew. influxdb 0.9.1

maxboiko avatar Jul 08 '15 12:07 maxboiko

@maxboiko I have the same setup as you and the CQ works for me. I think perhaps the fact that your data is more sparsely distributed than your GROUP BY duration might be the issue. You're grouping by 1s intervals but you have less than one point per second.

Can you reproduce the issue with a larger GROUP BY interval?

beckettsean avatar Jul 08 '15 22:07 beckettsean

@sartaj10 I'm not sure I follow what you're saying.

When I have no databases already created in InfluxDB and then create my first database, insert data and create a continuous query, it works

However, if I already have some databases created in InfluxDB, the same procedure fails.

In both cases the order of operations is create database then insert data and then create CQ. I'm not sure I understand how the two differ. Can you clarify?

beckettsean avatar Jul 08 '15 22:07 beckettsean

@vptheron CQ creation works fine for me without the AS syntax. I think it might be a coincidence that it worked with that change.

beckettsean avatar Jul 08 '15 22:07 beckettsean

@beckettsean I'll send a snapshot of my issue

sartaj10 avatar Jul 08 '15 23:07 sartaj10

@beckettsean Thanks, it works with 1h group by, but it recalculated only fresh points (just added before test). Should I change following property in configuration (recompute-no-older-than = "10m")? How large this property value can be and how does it affect performance?

maxboiko avatar Jul 09 '15 06:07 maxboiko

@maxboiko my apologies but I still haven't personally investigated the behavior of those config settings so I can't be sure how they behave or what limits they might have. They are a new feature. @dgnorton any words of advice?

beckettsean avatar Jul 09 '15 19:07 beckettsean

I always have to wait a minute or two for series/measurements to initially appear from continuous queries (see my comment on https://github.com/influxdb/influxdb/issues/3247#issuecomment-122055326). Could that be the reason for the intermittent behavior?

kruckenb avatar Jul 16 '15 19:07 kruckenb

I'm going to close this due to being an older version. Please try again with a more recent version and open a new issue if there is still an issue. Thanks!

jsternberg avatar May 17 '16 18:05 jsternberg