Open PS1TD opened 1 month ago
Just tried reproducing again but this time doing (NOW()::date - INTERVAL '1 minute') on time in Step 9 to keep all readings in 1 day and got even weirder results where none of the aggregates updated. Creating readings 1 month ahead however forces the Monthly aggregate to update.
Also would like to point out the the underlying SELECT queries do in fact return correct and up-to-date data, its just the view that is not updated
I think I have figured out what the problem was. It has to do with how the watermark behaves when you create continuous aggregations WITH DATA. Appending to WITH NO DATA has returned the behavior to expected. I feel like this should be mentioned somewhere more visible than the troubleshooting section. Linking similar issues https://github.com/timescale/timescaledb/issues/5775 https://github.com/timescale/timescaledb/issues/5379
Ill keep the issue open so that it is noticed, feel free to close it
What type of bug is this?
Incorrect result
What subsystems and features are affected?
Continuous aggregate
What happened?
I am trying to set up a layered real time aggregation structure similar to how it is described in the docs. Link I take readings from multiple sensors every minute. I need to aggregate them into time buckets of hour, day, week, month, and year. Minute hypertable -> real time hourly real time hourly -> real time daily real time daily -> real time weekly real time daily -> real time monthly real time monthly -> real time yearly
On the initial creation all aggregations seem to do what they are supposed to. I get all views properly populated with aggregated data. However as soon as data changes only the hour, day and week aggregations get updated. Month and Year aggregates do not behave like real time aggregates in this case. Trying to manually refresh them does not help and creating an update policy does not help either.
TimescaleDB version affected
2.16.1
PostgreSQL version used
16
What operating system did you use?
Docker Container on Linux (Ubuntu)
What installation method did you use?
Docker
What platform did you run on?
On prem/Self-hosted
Relevant log output and stack trace
No response
How can we reproduce the bug?
Step 2: Fill it with data
Step 3: Convert to hypertable
Step 4: Create hourly real time aggregate
Step 5: Create daily real time aggregate
Step 6: Create weekly real time aggregate
Step 7: Create monthly real time aggregate
Step 8: Create yearly real time aggregate
Step 9: Add new data (Notice in my case 20 new sensors were added and the previous 10 recieved new data)
After all these steps SensorReadingsHourly, Daily & Weekly will have new sensor, Monthly and Yearly won't
Things I have tried to refresh the not working aggregates
Manually refresh aggregate. Returns that aggregate is already up to date.
Create short schedule refresh policies. They run but nothing changes.
Re-enabling real time aggregation in case it did not apply first time
Help Wanted
It might totally be a user error and I maybe have misunderstood something in the documentation but the setup seems reasonable. Any help with this case will be much appreciated <3