Skip to content

Conversation

@mkindahl
Copy link
Contributor

@mkindahl mkindahl commented Oct 3, 2025

To support migration from trigger-based invalidation collection to WAL-based invalidation collection, or the opposite, the function _timescaledb_functions.set_invalidation_method is introduced. When called with a hypertable (that has continuous aggregates connected) and an invalidation method, it will flush the hypertable invalidations and changes the collection method for the hypertable to use the requested one.

It will changes the collection method for all continuous aggregates connected to the given hypertable, not just for a single continuous aggregate.

Also adds tests for the migration to check that it works properly.

@mkindahl mkindahl force-pushed the cagg-wal-inval-migrate branch 4 times, most recently from d340002 to 4ae0ecc Compare October 4, 2025 12:55
@mkindahl mkindahl linked an issue Oct 4, 2025 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Oct 4, 2025

Codecov Report

❌ Patch coverage is 88.57143% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.89%. Comparing base (36d0af7) to head (4ae0ecc).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
tsl/src/continuous_aggs/invalidation.c 84.44% 0 Missing and 7 partials ⚠️
tsl/src/continuous_aggs/common.c 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8738      +/-   ##
==========================================
- Coverage   82.48%   80.89%   -1.59%     
==========================================
  Files         247      247              
  Lines       47591    47483     -108     
  Branches    12114    12061      -53     
==========================================
- Hits        39254    38412     -842     
- Misses       3474     4244     +770     
+ Partials     4863     4827      -36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mkindahl mkindahl force-pushed the cagg-wal-inval-migrate branch 2 times, most recently from 92ecc1b to b2f122b Compare October 6, 2025 07:08
To support migration from trigger-based invalidation collection to
WAL-based invalidation collection, or the opposite, the function
`_timescaledb_functions.set_invalidation_method` is introduced.
When called with a hypertable (that has continuous aggregates
connected) and an invalidation method, it will flush the hypertable
invalidations and changes the collection method for the hypertable to
use the requested one.

It will changes the collection method for *all* continuous aggregates
connected to the given hypertable, not just for a single continuous
aggregate.

Also adds tests for the migration to check that it works properly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate continuous aggregates to WAL-based invalidation collection

2 participants