timescaledb
timescaledb copied to clipboard
Fix error in show_chunks
If "created_after/before" is used with a "time" type partitioning column then show_chunks was not showing appropriate list due to a mismatch in the comparison of the "creation_time" metadata (which is stored as a timestamptz) with the internally converted epoch based input argument value. This is now fixed by not doing the unnecessary conversion into the internal format for cases where it's not needed.
Fixes #6611
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 80.96%. Comparing base (
59f50f2
) to head (799ee65
). Report is 62 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #6617 +/- ##
==========================================
+ Coverage 80.06% 80.96% +0.89%
==========================================
Files 190 191 +1
Lines 37181 36356 -825
Branches 9450 9435 -15
==========================================
- Hits 29770 29436 -334
- Misses 2997 3168 +171
+ Partials 4414 3752 -662
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Does this also fix add_compression_policy()
with the compress_created_before
argument?
add_compression_policy
@kevcenteno the add_compression_policy
API takes in an interval only as input. I believe the handling for that is good enough. Did you see any issues with it in your testing?
@nikkhils I did see the same issue with the add_compression_policy
when using the compress_created_before
argument; that is, chunks were immediately being compressed without satisfying the interval:
Given
SELECT add_compression_policy('cpu', compress_created_before => INTERVAL '3 hours');
Expect A chunk that was created 1 hour ago to not be compressed
Actual The chunk that was created 1 hour ago is compressed
This lead me to discovering the show_chunks
issue. In both cases, I used an interval.
@nikkhils I did see the same issue with the
add_compression_policy
when using thecompress_created_before
argument; that is, chunks were immediately being compressed without satisfying the interval:Given
SELECT add_compression_policy('cpu', compress_created_before => INTERVAL '3 hours');
Expect A chunk that was created 1 hour ago to not be compressed
Actual The chunk that was created 1 hour ago is compressed
This lead me to discovering the
show_chunks
issue. In both cases, I used an interval.
@kevcenteno right. So, the compression policy job calls show_chunks
underneath. Since this PR now fixes show_chunks
, the issue with the add_compression_policy
is also fixed now. Thanks for the report!
@nikkhils I suspected as much, but thank you for verifying!