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 segfault creating CAgg on hypertable by hash #6981

Conversation

fabriziomello
Copy link
Contributor

@fabriziomello fabriziomello commented May 31, 2024

The new hypertable API allows create it with primary space partition and CAggs doesn't support hypertables with custom partition functions.

Fixed the segfault by properly checking if there are an open dimension available during the validation.

Disable-check: force-changelog-file

Copy link

codecov bot commented May 31, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.74%. Comparing base (59f50f2) to head (a5d846c).
Report is 199 commits behind head on main.

Files Patch % Lines
tsl/src/continuous_aggs/common.c 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6981      +/-   ##
==========================================
+ Coverage   80.06%   81.74%   +1.68%     
==========================================
  Files         190      199       +9     
  Lines       37181    37015     -166     
  Branches     9450     9673     +223     
==========================================
+ Hits        29770    30259     +489     
+ Misses       2997     2862     -135     
+ Partials     4414     3894     -520     

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

@fabriziomello fabriziomello force-pushed the fix_segfault_create_cagg_on_hypertable_by_hash branch from d917a6f to 561f428 Compare June 3, 2024 17:32
@fabriziomello fabriziomello added the segfault Segmentation fault label Jun 3, 2024
@fabriziomello fabriziomello force-pushed the fix_segfault_create_cagg_on_hypertable_by_hash branch from 561f428 to 38e294f Compare June 4, 2024 21:55
@fabriziomello fabriziomello added this to the TimescaleDB 2.15.2 milestone Jun 4, 2024
@@ -2116,3 +2116,20 @@ SELECT * FROM _timescaledb_catalog.compression_settings;
-------+-----------+---------+--------------+--------------------
(0 rows)

-- hash partitioning test
CREATE TABLE test_by_hash (id BIGINT, value FLOAT8);
SELECT create_hypertable('test_by_hash', by_hash('id', 8));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabriziomello with my PR #6993 we won't allow creation of hypertables with by_hash

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

The new hypertable API allows create it with primary space partition and
CAggs doesn't support hypertables with custom partition functions.

Fixed the segfault by properly checking if there are an open dimension
available during the validation.
@fabriziomello fabriziomello force-pushed the fix_segfault_create_cagg_on_hypertable_by_hash branch from 38e294f to a5d846c Compare June 5, 2024 12:50
@fabriziomello fabriziomello merged commit 577cda4 into timescale:main Jun 5, 2024
36 of 37 checks passed
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.

5 participants