timescaledb
timescaledb copied to clipboard
Fix policy refresh window too small
When adding a CAgg refresh policy using start_offset => '2 months'
and end_offset => '0 months'
was failing because the policy refresh window is too small and it should cover at least two buckets in the valid time range of timestamptz.
The problem was when calculating the bucket width for the variable bucket size (like months) we're assuming 31 days for each month but when converting the end offset to integer using interval_to_int64
we use 30 days per month. Fixed it by aligning the variable bucket size calculation to also use 30 days.
Disable-check: force-changelog-file
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 81.00%. Comparing base (
59f50f2
) to head (7939a78
). Report is 142 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #6885 +/- ##
==========================================
+ Coverage 80.06% 81.00% +0.94%
==========================================
Files 190 198 +8
Lines 37181 37286 +105
Branches 9450 9734 +284
==========================================
+ Hits 29770 30205 +435
- Misses 2997 3189 +192
+ Partials 4414 3892 -522
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Automated backport to 2.14.x not done: cherry-pick failed.
Git status
HEAD detached at origin/2.14.x
You are currently cherry-picking commit d8057c432.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --skip" to skip this patch)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Changes to be committed:
modified: tsl/test/expected/exp_cagg_monthly.out
modified: tsl/test/sql/exp_cagg_monthly.sql
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: tsl/src/bgw_policy/continuous_aggregate_api.c