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 on CAggs with multiple JOINs #7146

Conversation

fabriziomello
Copy link
Contributor

@fabriziomello fabriziomello commented Jul 22, 2024

Creating or changing to realtime a Continuous Aggregate with multiple joins was leading to a segfault.

Fixed it by dealing properly with the varno when creating the Quals for the union view in realtime mode.

Also get rid of some left over when we relaxed the CAggs join restrictions in #7111.

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

Copy link

codecov bot commented Jul 23, 2024

Codecov Report

Attention: Patch coverage is 93.93939% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.77%. Comparing base (59f50f2) to head (57f7b71).
Report is 264 commits behind head on main.

Files Patch % Lines
tsl/src/continuous_aggs/common.c 84.61% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7146      +/-   ##
==========================================
+ Coverage   80.06%   81.77%   +1.70%     
==========================================
  Files         190      203      +13     
  Lines       37181    37960     +779     
  Branches     9450     9845     +395     
==========================================
+ Hits        29770    31042    +1272     
+ Misses       2997     2965      -32     
+ Partials     4414     3953     -461     

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

@fabriziomello fabriziomello force-pushed the cagg_fix_segfault_with_multiple_joins branch from f5ccd4c to 1e29cd1 Compare July 23, 2024 14:53
Creating or changing to realtime a Continuous Aggregate with multiple
joins was leading to a segfault.

Fixed it by dealing properly with the `varno` when creating the `Quals`
for the union view in realtime mode.

Also get rid of some left over when we relaxed the CAggs join
restrictions in timescale#7111.
Refactored the Hierarchical Continuous Aggregate regression tests
including more columns in JOIN tests and also added an `ORDER BY`
clause to definition to avoid flake tests when querying and show
the result rows.
@fabriziomello fabriziomello force-pushed the cagg_fix_segfault_with_multiple_joins branch from 22902ae to 57f7b71 Compare July 23, 2024 17:59
@fabriziomello fabriziomello merged commit 11af761 into timescale:main Jul 23, 2024
40 of 42 checks passed
@timescale-automation
Copy link

Automated backport to 2.15.x not done: cherry-pick failed.

Git status

HEAD detached at origin/2.15.x
You are currently cherry-picking commit 95acaa406.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   tsl/src/continuous_aggs/common.c
	modified:   tsl/src/continuous_aggs/common.h
	modified:   tsl/test/expected/cagg_repair-14.out
	modified:   tsl/test/expected/cagg_repair-15.out
	modified:   tsl/test/expected/cagg_repair-16.out

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   tsl/src/continuous_aggs/finalize.c
	both modified:   tsl/test/expected/cagg_joins.out
	both modified:   tsl/test/sql/cagg_joins.sql


Job log

@timescale-automation timescale-automation added the auto-backport-not-done Automated backport of this PR has failed non-retriably (e.g. conflicts) label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport-not-done Automated backport of this PR has failed non-retriably (e.g. conflicts) bug continuous_aggregate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants