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 crash while tracking alter table commands #3462

Merged
merged 1 commit into from
Aug 5, 2021

Conversation

nikkhils
Copy link
Contributor

@nikkhils nikkhils commented Aug 4, 2021

In this specific case, when we create a hypertable then
we add a "not-null" constraint to the "time" column if it
does not exist. That is done via an internal ALTER TABLE
subcommand in dimension_add_not_null_on_column function. If the
currentEventTriggerState structure is enabled then it's necessary to
set up the command tracking appropriately, otherwise crash ensues. This
has been fixed via this now.

Fixes #3442

@nikkhils nikkhils self-assigned this Aug 4, 2021
@nikkhils nikkhils requested a review from a team as a code owner August 4, 2021 08:36
@nikkhils nikkhils requested review from afiskon, erimatnor and mfundul and removed request for a team August 4, 2021 08:36
@codecov
Copy link

codecov bot commented Aug 4, 2021

Codecov Report

Merging #3462 (783f5dc) into master (d3cb880) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3462      +/-   ##
==========================================
- Coverage   90.71%   90.70%   -0.02%     
==========================================
  Files         212      212              
  Lines       36256    36258       +2     
==========================================
- Hits        32890    32888       -2     
- Misses       3366     3370       +4     
Impacted Files Coverage Δ
src/dimension.c 95.44% <100.00%> (+0.01%) ⬆️
src/loader/bgw_message_queue.c 85.52% <0.00%> (-2.64%) ⬇️

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 d3cb880...783f5dc. Read the comment docs.

Copy link
Contributor

@pmwkaa pmwkaa left a comment

Choose a reason for hiding this comment

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

Do you think we can test it?

@mfundul
Copy link
Contributor

mfundul commented Aug 4, 2021

Do you think we can test it?

You could add the reproduction steps from #3442 as the test.

In this specific case, when we create a hypertable then
we add a "not-null" constraint to the "time" column if it
does not exist. That is done via an internal ALTER TABLE
subcommand in dimension_add_not_null_on_column function. If the
currentEventTriggerState structure is enabled then it's necessary to
set up the command tracking appropriately, otherwise crash ensues. This
has been fixed via this now.

Includes test changes.
@nikkhils
Copy link
Contributor Author

nikkhils commented Aug 5, 2021

Do you think we can test it?

You could add the reproduction steps from #3442 as the test.

Done @mfundul and @pmwkaa

@nikkhils nikkhils merged commit e1c5a98 into timescale:master Aug 5, 2021
@nikkhils nikkhils deleted the ctas_crash branch August 5, 2021 10:54
mkindahl added a commit to mkindahl/timescaledb that referenced this pull request Aug 19, 2021
This release contains bug fixes since the 2.4.0 release.  We deem it
high priority to upgrade.

The release fixes continous aggregate refresh for postgres 12.8 and
13.4, a crash with ALTER TABLE commands and a crash with continuous
aggregates with HAVING clause.

**Bugfixes**
* timescale#3430 Fix havingqual processing for continuous aggregates
* timescale#3468 Disable tests by default if tools are not found
* timescale#3462 Fix crash while tracking alter table commands
* timescale#3489 Fix continuous agg bgw job failure for PG 12.8 and 13.4
* timescale#3494 Improve error message when adding data nodes

**Thanks**
* @brianbenns for reporting a segfault with continuous aggregates
* @brianbenns for reporting a segfault with continuous aggregates
* @usego for reporting an issue with continuous aggregate refresh on PG 13.4
mkindahl added a commit that referenced this pull request Aug 19, 2021
This release contains bug fixes since the 2.4.0 release.  We deem it
high priority to upgrade.

The release fixes continous aggregate refresh for postgres 12.8 and
13.4, a crash with ALTER TABLE commands and a crash with continuous
aggregates with HAVING clause.

**Bugfixes**
* #3430 Fix havingqual processing for continuous aggregates
* #3468 Disable tests by default if tools are not found
* #3462 Fix crash while tracking alter table commands
* #3489 Fix continuous agg bgw job failure for PG 12.8 and 13.4
* #3494 Improve error message when adding data nodes

**Thanks**
* @brianbenns for reporting a segfault with continuous aggregates
* @brianbenns for reporting a segfault with continuous aggregates
* @usego for reporting an issue with continuous aggregate refresh on PG 13.4
mkindahl added a commit to mkindahl/timescaledb that referenced this pull request Aug 19, 2021
This release contains bug fixes since the 2.4.0 release.  We deem it
high priority to upgrade.

The release fixes continous aggregate refresh for postgres 12.8 and
13.4, a crash with ALTER TABLE commands and a crash with continuous
aggregates with HAVING clause.

**Bugfixes**
* timescale#3430 Fix havingqual processing for continuous aggregates
* timescale#3468 Disable tests by default if tools are not found
* timescale#3462 Fix crash while tracking alter table commands
* timescale#3489 Fix continuous agg bgw job failure for PG 12.8 and 13.4
* timescale#3494 Improve error message when adding data nodes

**Thanks**
* @brianbenns for reporting a segfault with continuous aggregates
* @brianbenns for reporting a segfault with continuous aggregates
* @usego for reporting an issue with continuous aggregate refresh on PG 13.4
mkindahl added a commit that referenced this pull request Aug 19, 2021
This release contains bug fixes since the 2.4.0 release.  We deem it
high priority to upgrade.

The release fixes continous aggregate refresh for postgres 12.8 and
13.4, a crash with ALTER TABLE commands and a crash with continuous
aggregates with HAVING clause.

**Bugfixes**
* #3430 Fix havingqual processing for continuous aggregates
* #3468 Disable tests by default if tools are not found
* #3462 Fix crash while tracking alter table commands
* #3489 Fix continuous agg bgw job failure for PG 12.8 and 13.4
* #3494 Improve error message when adding data nodes

**Thanks**
* @brianbenns for reporting a segfault with continuous aggregates
* @usego for reporting an issue with continuous aggregate refresh on PG 13.4
mkindahl added a commit that referenced this pull request Aug 19, 2021
This release contains bug fixes since the 2.4.0 release.  We deem it
high priority to upgrade.

The release fixes continous aggregate refresh for postgres 12.8 and
13.4, a crash with ALTER TABLE commands and a crash with continuous
aggregates with HAVING clause.

**Bugfixes**
* #3430 Fix havingqual processing for continuous aggregates
* #3468 Disable tests by default if tools are not found
* #3462 Fix crash while tracking alter table commands
* #3489 Fix continuous agg bgw job failure for PG 12.8 and 13.4
* #3494 Improve error message when adding data nodes

**Thanks**
* @brianbenns for reporting a segfault with continuous aggregates
* @brianbenns for reporting a segfault with continuous aggregates
* @usego for reporting an issue with continuous aggregate refresh on PG 13.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash with CREATE TABLE AS
4 participants