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 show_chunks on hypertable by hash #6984

Conversation

fabriziomello
Copy link
Contributor

@fabriziomello fabriziomello commented May 31, 2024

Using the new hypertable API creating closed dimentions when partitioning by hash was leading to a segfault on show_chunks.

Fixed it by checking for the closed primary dimension and erroring out in case of using parameters older_than and newer_than.

Disable-check: force-changelog-file

Copy link

codecov bot commented May 31, 2024

Codecov Report

Attention: Patch coverage is 28.57143% with 5 lines in your changes missing coverage. Please review.

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

Files Patch % Lines
src/chunk.c 28.57% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6984      +/-   ##
==========================================
+ Coverage   80.06%   81.74%   +1.68%     
==========================================
  Files         190      199       +9     
  Lines       37181    37026     -155     
  Branches     9450     9680     +230     
==========================================
+ Hits        29770    30268     +498     
+ Misses       2997     2863     -134     
+ Partials     4414     3895     -519     

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

src/chunk.c Show resolved Hide resolved
@fabriziomello fabriziomello force-pushed the fix_show_chunks_on_hypertable_by_hash branch from 0864cb1 to 464cf15 Compare June 3, 2024 17:30
@fabriziomello fabriziomello added segfault Segmentation fault labels Jun 3, 2024
@fabriziomello fabriziomello force-pushed the fix_show_chunks_on_hypertable_by_hash branch 2 times, most recently from 021e98d to 40883c1 Compare June 4, 2024 21:55
@fabriziomello fabriziomello added this to the TimescaleDB 2.15.2 milestone Jun 4, 2024
-- Hypertable by hash partitioning
CREATE TABLE test_by_hash (id BIGINT, value FLOAT8);
SELECT create_hypertable('test_by_hash', by_hash('id', 10));
create_hypertable
Copy link
Contributor

@nikkhils nikkhils Jun 5, 2024

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 hypertable 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!

@fabriziomello fabriziomello force-pushed the fix_show_chunks_on_hypertable_by_hash branch from 40883c1 to 3a7611b Compare June 5, 2024 12:44
@fabriziomello fabriziomello force-pushed the fix_show_chunks_on_hypertable_by_hash branch from 3a7611b to 1109d85 Compare June 5, 2024 14:13
src/chunk.c Outdated
time_dim = hyperspace_get_closed_dimension(ht->space, 0);

Ensure(time_dim != NULL,
"time dimension not found for hypertable \"%s\".\"%s\"",
Copy link
Contributor

Choose a reason for hiding this comment

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

@fabriziomello should the message be: "partitioning dimesion not found for hypertable"?

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!

@fabriziomello fabriziomello force-pushed the fix_show_chunks_on_hypertable_by_hash branch from 1109d85 to e38bee4 Compare June 5, 2024 18:24
Using the new hypertable API creating closed dimentions when
partitioning by hash was leading to a segfault on show_chunks.

Fixed it by checking for the closed primary dimension and erroring out
in case of using parameters `older_than` and `newer_than`.
@fabriziomello fabriziomello force-pushed the fix_show_chunks_on_hypertable_by_hash branch from e38bee4 to ee88a5c Compare June 5, 2024 20:10
@fabriziomello fabriziomello enabled auto-merge (rebase) June 5, 2024 20:10
Copy link
Contributor

@nikkhils nikkhils left a comment

Choose a reason for hiding this comment

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

LGTM!

@fabriziomello fabriziomello merged commit 4aff9b1 into timescale:main Jun 6, 2024
38 of 39 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.

4 participants