Skip to content

Continuous query does not calculate averages for all values of a tag #7627

Open
@jaapz

Description

@jaapz

Bug report

I have one large measurement in my database, called log_record. This measurement stores sensor values for a lot of sensors. There are two retention policies:

  1. four_weeks; contains four weeks of "raw" sensor data, about 10s interval
  2. forever; contains averages over 2 minutes and keeps that data forever

Averages in the forever retention policy are calculated using this continuous query:

CREATE CONTINUOUS QUERY cq_aggregate_log_record ON mydb 
BEGIN 
    SELECT mean(value) AS value 
    INTO mydb.forever.log_record 
    FROM mydb.four_weeks.log_record 
    GROUP BY time(2m), * 
END

However, some series are not handled by this query, so their data is not averaged and saved in the forever retention policy, even though they have data in the four_weeks retention policy.

When I manually execute the exact same query, averages are correctly calculated for all series.

I have manually removed and added the continuous query to no avail.

I have also added a new continuous query, that specified a certain sensor_id, like this:

CREATE CONTINUOUS QUERY cq_aggregate_log_record ON mydb 
BEGIN 
    SELECT mean(value) AS value 
    INTO mydb.forever.log_record 
    FROM mydb.four_weeks.log_record 
    WHERE sensor_id='4790'
    GROUP BY time(2m), * 
END

And this continuous query also does not work, so averages are not calculated, even when specifying a value for the sensor_id.

System info:
InfluxDB 1.1
Ubuntu 16.10

Steps to reproduce:
Hard to say...

Expected behavior:
Continuous query should calculate averages over 2 minute periods for every series in the measurement.

Actual behavior:
Averages are only calculated for about 70 or 80% of series, rest isn't handled at all.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions