Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CAgg on CAgg variable bucket size validation #5170

Conversation

fabriziomello
Copy link
Contributor

Previous attempt to fix it (PR #5130) was not entirely correct because the bucket width calculation for interval width was wrong.

Fixed it by properly calculate the bucket width for intervals using the Postgres internal function interval_part to extract the epoch of the interval and execute the validations. For integer widths use the already calculated bucket width.

Fixes #5158, #5168

@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

Merging #5170 (8f0786a) into main (ca9d508) will increase coverage by 27.39%.
The diff coverage is 73.52%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #5170       +/-   ##
===========================================
+ Coverage   61.85%   89.24%   +27.39%     
===========================================
  Files         225      225               
  Lines       45618    51778     +6160     
===========================================
+ Hits        28217    46210    +17993     
+ Misses      17401     5568    -11833     
Impacted Files Coverage Δ
tsl/src/continuous_aggs/create.c 87.80% <73.52%> (+77.17%) ⬆️
tsl/test/src/test_chunk_stats.c 92.59% <0.00%> (-7.41%) ⬇️
src/uuid.c 78.57% <0.00%> (-6.05%) ⬇️
src/histogram.c 83.83% <0.00%> (-4.80%) ⬇️
tsl/src/fdw/fdw_utils.c 80.76% <0.00%> (-4.65%) ⬇️
src/time_utils.c 93.72% <0.00%> (-3.78%) ⬇️
src/time_bucket.c 95.81% <0.00%> (-2.76%) ⬇️
src/hypertable_cache.c 93.25% <0.00%> (-2.64%) ⬇️
tsl/src/dist_backup.c 92.30% <0.00%> (-2.52%) ⬇️
src/loader/bgw_message_queue.c 86.36% <0.00%> (-2.46%) ⬇️
... and 202 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca9d508...8f0786a. Read the comment docs.

@fabriziomello fabriziomello force-pushed the fix_cagg_on_cagg_bucket_size_validation_take2 branch 12 times, most recently from 72da7cb to acffcc6 Compare January 11, 2023 18:47
@fabriziomello fabriziomello marked this pull request as ready for review January 11, 2023 19:49
@github-actions
Copy link

@pmwkaa, @nikkhils: please review this pull request.

Powered by pull-review

@fabriziomello fabriziomello force-pushed the fix_cagg_on_cagg_bucket_size_validation_take2 branch 4 times, most recently from c068802 to ddc7742 Compare January 12, 2023 22:31
Previous attempt to fix it (PR timescale#5130) was not entirely correct because
the bucket width calculation for interval width was wrong.

Fixed it by properly calculate the bucket width for intervals using the
Postgres internal function `interval_part` to extract the epoch of the
interval and execute the validations. For integer widths use the already
calculated bucket width.

Fixes timescale#5158, timescale#5168
@fabriziomello fabriziomello force-pushed the fix_cagg_on_cagg_bucket_size_validation_take2 branch from ddc7742 to 8f0786a Compare January 13, 2023 14:35
@fabriziomello fabriziomello merged commit 73df496 into timescale:main Jan 13, 2023
@fabriziomello fabriziomello added this to the TimescaleDB 2.9.2 milestone Jan 17, 2023
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 18, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5180 Fix dist_cagg flaky test
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5172 Remove parallel safe from partialize_agg
* timescale#5162 Fix telemetry_stats test in PG15
* timescale#5130 Fix CAgg on CAgg variable bucket size validation
* timescale#5133 Fix CAgg on CAgg different column order
* timescale#5152 Fix adding column with NULL constraint
* timescale#5136 Fix SELECT from partial compressed chunks
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
@sb230132 sb230132 mentioned this pull request Jan 18, 2023
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 18, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5180 Fix dist_cagg flaky test
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5172 Remove parallel safe from partialize_agg
* timescale#5162 Fix telemetry_stats test in PG15
* timescale#5133 Fix CAgg on CAgg different column order on the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5136 Fix SELECT from partial compressed chunks
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 19, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5180 Fix dist_cagg flaky test
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5172 Remove parallel safe from partialize_agg
* timescale#5162 Fix telemetry_stats test in PG15
* timescale#5133 Fix CAgg on CAgg different column order on the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5136 Fix SELECT from partial compressed chunks
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
* timescale#5193 Fix repartition behavior when attaching data node
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 19, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5180 Fix dist_cagg flaky test
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5133 Fix CAgg on CAgg different column order on the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
* timescale#5193 Fix repartition behavior when attaching data node
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 19, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5180 Fix dist_cagg flaky test
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5133 Fix CAgg on CAgg different column order on the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
* timescale#5193 Fix repartition behavior when attaching data node
@sb230132 sb230132 mentioned this pull request Jan 19, 2023
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 19, 2023
Release 2.9.2

This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5133 Fix CAgg on CAgg different column order on the original hypertable
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5180 Fix default data node availability status
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
* timescale#5193 Fix repartition behavior when attaching data node
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 19, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5133 Fix CAgg on CAgg different column order on the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5180 Fix default data node availability status
* timescale#5181 Fix ChunkAppend, ConstraintAwareAppend child subplan
* timescale#5193 Fix repartition behavior when attaching data node
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 20, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5114 Fix issue with deleting data node and dropping database
* timescale#5133 Fix CAgg on CAgg using different column order on the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5180 Fix default data node availability status
* timescale#5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* timescale#5193 Fix repartition behavior when attaching data node
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 23, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5114 Fix issue with deleting data node and dropping the database on multi-node
* timescale#5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5180 Fix default data node availability status on multi-node
* timescale#5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* timescale#5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit to sb230132/timescaledb that referenced this pull request Jan 23, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#5114 Fix issue with deleting data node and dropping the database on multi-node
* timescale#5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* timescale#5152 Fix adding column with NULL constraint to compressed hypertable
* timescale#5170 Fix CAgg on CAgg variable bucket size validation
* timescale#5180 Fix default data node availability status on multi-node
* timescale#5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* timescale#5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit that referenced this pull request Jan 23, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #5114 Fix issue with deleting data node and dropping the database on multi-node
* #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* #5152 Fix adding column with NULL constraint to compressed hypertable
* #5170 Fix CAgg on CAgg variable bucket size validation
* #5180 Fix default data node availability status on multi-node
* #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* #5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit that referenced this pull request Jan 24, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #5114 Fix issue with deleting data node and dropping the database on multi-node
* #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* #5152 Fix adding column with NULL constraint to compressed hypertable
* #5170 Fix CAgg on CAgg variable bucket size validation
* #5180 Fix default data node availability status on multi-node
* #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* #5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit that referenced this pull request Jan 24, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #5114 Fix issue with deleting data node and dropping the database on multi-node
* #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* #5152 Fix adding column with NULL constraint to compressed hypertable
* #5170 Fix CAgg on CAgg variable bucket size validation
* #5180 Fix default data node availability status on multi-node
* #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* #5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit that referenced this pull request Jan 24, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #5114 Fix issue with deleting data node and dropping the database on multi-node
* #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* #5152 Fix adding column with NULL constraint to compressed hypertable
* #5170 Fix CAgg on CAgg variable bucket size validation
* #5180 Fix default data node availability status on multi-node
* #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* #5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit that referenced this pull request Jan 24, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #5114 Fix issue with deleting data node and dropping the database on multi-node
* #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* #5152 Fix adding column with NULL constraint to compressed hypertable
* #5170 Fix CAgg on CAgg variable bucket size validation
* #5180 Fix default data node availability status on multi-node
* #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* #5193 Fix repartition behavior when attaching data node on multi-node
sb230132 added a commit that referenced this pull request Jan 24, 2023
This release contains bug fixes since the 2.9.1 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #5114 Fix issue with deleting data node and dropping the database on multi-node
* #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable
* #5152 Fix adding column with NULL constraint to compressed hypertable
* #5170 Fix CAgg on CAgg variable bucket size validation
* #5180 Fix default data node availability status on multi-node
* #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan
* #5193 Fix repartition behavior when attaching data node on multi-node
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.

[Bug]: Cannot create monthly CAGG on a daily CAGG
3 participants