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 ChunkAppend with prepared statements #1369

Merged

Conversation

svenklemm
Copy link
Member

ChunkAppend replaced the list of child plans on the plan node with
a local copy which corrupted the child plans when the plan was
turned into a generic plan.

Fixes #1368

@svenklemm svenklemm requested a review from cevian July 24, 2019 09:05
@svenklemm svenklemm force-pushed the chunk_append_prepared_statements branch from 7f73f48 to 0b0594b Compare July 24, 2019 09:13
@codecov
Copy link

codecov bot commented Jul 24, 2019

Codecov Report

Merging #1369 into master will decrease coverage by 11.31%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1369       +/-   ##
===========================================
- Coverage   92.05%   80.73%   -11.32%     
===========================================
  Files         114      112        -2     
  Lines       14756    16104     +1348     
===========================================
- Hits        13584    13002      -582     
- Misses       1172     3102     +1930
Impacted Files Coverage Δ
src/chunk_append/exec.c 97.7% <100%> (+1.41%) ⬆️
src/scan_iterator.h 0% <0%> (-100%) ⬇️
src/chunk.h 0% <0%> (-100%) ⬇️
src/utils.h 0% <0%> (-100%) ⬇️
src/chunk_insert_state.c 33% <0%> (-64.26%) ⬇️
src/plan_add_hashagg.c 40.62% <0%> (-57.46%) ⬇️
tsl/src/gapfill/gapfill.c 45.45% <0%> (-54.55%) ⬇️
src/plan_expand_hypertable.c 42.17% <0%> (-52.54%) ⬇️
tsl/src/continuous_aggs/options.c 55.1% <0%> (-42.55%) ⬇️
src/copy.c 45.95% <0%> (-41.55%) ⬇️
... and 97 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 c6000e9...0b0594b. Read the comment docs.

@codecov
Copy link

codecov bot commented Jul 24, 2019

Codecov Report

Merging #1369 into master will decrease coverage by 11.29%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1369      +/-   ##
==========================================
- Coverage   92.05%   80.76%   -11.3%     
==========================================
  Files         114      114              
  Lines       14758    16437    +1679     
==========================================
- Hits        13586    13275     -311     
- Misses       1172     3162    +1990
Impacted Files Coverage Δ
src/chunk_append/exec.c 96.53% <100%> (+0.24%) ⬆️
src/scan_iterator.h 0% <0%> (-100%) ⬇️
src/chunk.h 0% <0%> (-100%) ⬇️
src/utils.h 0% <0%> (-100%) ⬇️
src/chunk_insert_state.c 31.62% <0%> (-65.64%) ⬇️
tsl/src/gapfill/gapfill.c 45.45% <0%> (-54.55%) ⬇️
src/plan_expand_hypertable.c 42.35% <0%> (-52.35%) ⬇️
src/plan_add_hashagg.c 46.87% <0%> (-51.21%) ⬇️
src/copy.c 44.67% <0%> (-42.83%) ⬇️
tsl/src/continuous_aggs/options.c 55.1% <0%> (-42.55%) ⬇️
... and 96 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 c6000e9...39a57a7. Read the comment docs.

ChunkAppend replaced the list of child plans on the plan node with
a local copy which corrupted the child plans when the plan was
turned into a generic plan.
@svenklemm svenklemm force-pushed the chunk_append_prepared_statements branch from 0b0594b to 39a57a7 Compare July 24, 2019 13:43
@svenklemm svenklemm merged commit 9551f4a into timescale:master Jul 24, 2019
@svenklemm svenklemm added this to the 1.4.1 milestone Jul 28, 2019
@svenklemm svenklemm added the bug label Jul 28, 2019
@svenklemm svenklemm mentioned this pull request Jul 31, 2019
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Jul 31, 2019
This maintenance release contains bugfixes since the 1.4.0 release. We deem it medium
priority for upgrading.

In particular the fixes contained in this maintenance release address 2 potential
segfaults and no other security vulnerabilities. The bugfixes are related to queries
with prepared statements, PL/pgSQL functions and interoperability with other extensions.
More details below.

**Bugfixes**
* timescale#1362 Fix ConstraintAwareAppend subquery exclusion
* timescale#1363 Mark drop_chunks as VOLATILE and not PARALLEL SAFE
* timescale#1369 Fix ChunkAppend with prepared statements
* timescale#1373 Only allow PARAM_EXTERN as time_bucket_gapfill arguments
* timescale#1380 Handle Result nodes gracefully in ChunkAppend

**Thanks**
* @overhacked for reporting an issue with drop_chunks and parallel queries
* @fvannee for reporting an issue with ConstraintAwareAppend and subqueries
* @rrb3942 for reporting a segfault with ChunkAppend and prepared statements
* @mchesser for reporting a segfault with time_bucket_gapfill and subqueries
* @lolizeppelin for reporting and helping debug an issue with ChunkAppend and Result nodes
svenklemm added a commit that referenced this pull request Jul 31, 2019
This maintenance release contains bugfixes since the 1.4.0 release. We deem it medium
priority for upgrading.

In particular the fixes contained in this maintenance release address 2 potential
segfaults and no other security vulnerabilities. The bugfixes are related to queries
with prepared statements, PL/pgSQL functions and interoperability with other extensions.
More details below.

**Bugfixes**
* #1362 Fix ConstraintAwareAppend subquery exclusion
* #1363 Mark drop_chunks as VOLATILE and not PARALLEL SAFE
* #1369 Fix ChunkAppend with prepared statements
* #1373 Only allow PARAM_EXTERN as time_bucket_gapfill arguments
* #1380 Handle Result nodes gracefully in ChunkAppend

**Thanks**
* @overhacked for reporting an issue with drop_chunks and parallel queries
* @fvannee for reporting an issue with ConstraintAwareAppend and subqueries
* @rrb3942 for reporting a segfault with ChunkAppend and prepared statements
* @mchesser for reporting a segfault with time_bucket_gapfill and subqueries
* @lolizeppelin for reporting and helping debug an issue with ChunkAppend and Result nodes
svenklemm added a commit that referenced this pull request Jul 31, 2019
This maintenance release contains bugfixes since the 1.4.0 release. We deem it medium
priority for upgrading.

In particular the fixes contained in this maintenance release address 2 potential
segfaults and no other security vulnerabilities. The bugfixes are related to queries
with prepared statements, PL/pgSQL functions and interoperability with other extensions.
More details below.

**Bugfixes**
* #1362 Fix ConstraintAwareAppend subquery exclusion
* #1363 Mark drop_chunks as VOLATILE and not PARALLEL SAFE
* #1369 Fix ChunkAppend with prepared statements
* #1373 Only allow PARAM_EXTERN as time_bucket_gapfill arguments
* #1380 Handle Result nodes gracefully in ChunkAppend

**Thanks**
* @overhacked for reporting an issue with drop_chunks and parallel queries
* @fvannee for reporting an issue with ConstraintAwareAppend and subqueries
* @rrb3942 for reporting a segfault with ChunkAppend and prepared statements
* @mchesser for reporting a segfault with time_bucket_gapfill and subqueries
* @lolizeppelin for reporting and helping debug an issue with ChunkAppend and Result nodes
@svenklemm svenklemm deleted the chunk_append_prepared_statements branch October 10, 2019 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash/Segfault after update to 1.4
2 participants