Skip to content

Conversation

@erimatnor
Copy link
Member

@erimatnor erimatnor commented Jan 16, 2026

Add tests for compression and reorder policies on UUIDv7 hypertables. Also fix an issue discovered for compression policies. Below is the description for the fix commit:

Fix compression policy on UUID hypertables

The get_chunk_to_recompress function passes the boundary value from get_window_boundary to ts_time_value_to_internal with the original partitioning type. However, for UUID-partitioned tables, get_window_boundary returns a TIMESTAMPTZ datum (not UUID), so we need to use TIMESTAMPTZOID for the conversion.

Fix this by converting the boundary_type to TIMESTAMPTZOID when the partitioning type is UUID, matching the approach used for retention policies.

Disable-check: commit-count
Disable-check: force-changelog-file

The get_chunk_to_recompress function passes the boundary value from
get_window_boundary to ts_time_value_to_internal with the original
partitioning type. However, for UUID-partitioned tables,
get_window_boundary returns a TIMESTAMPTZ datum (not UUID), so we need
to use TIMESTAMPTZOID for the conversion.

Fix this by converting the boundary_type to TIMESTAMPTZOID when the
partitioning type is UUID, matching the approach used for retention
policies.
Add a test for compression policy on UUID-partitioned hypertables.
The test verifies that compression policy with INTERVAL correctly
compresses chunks older than the specified threshold.
Add a test for reorder policy on UUID-partitioned hypertables.
The reorder policy works without any changes since it doesn't use
time-based parameters - it only requires an index name.
@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.54%. Comparing base (902c268) to head (aa7f104).

Files with missing lines Patch % Lines
tsl/src/bgw_policy/job.c 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9138      +/-   ##
==========================================
+ Coverage   82.42%   82.54%   +0.11%     
==========================================
  Files         244      244              
  Lines       47953    47930      -23     
  Branches    12235    12232       -3     
==========================================
+ Hits        39525    39563      +38     
- Misses       3553     3554       +1     
+ Partials     4875     4813      -62     

☔ 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.

@erimatnor erimatnor marked this pull request as ready for review January 16, 2026 17:16
@erimatnor erimatnor requested a review from a team January 16, 2026 17:16
@github-actions
Copy link

@antekresic, @natalya-aksman: please review this pull request.

Powered by pull-review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant