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 chunk creation on hypertables with non-default statistics #4538

Merged
merged 1 commit into from
Jul 22, 2022

Conversation

svenklemm
Copy link
Member

When triggering chunk creation on a hypertable with non-default
statistics targets by a user different from the hypertable owner
the chunk creation will fail with a permission error. This patch
changes the chunk table creation to run the attribute modification
as the table owner.

Fixes #4474

@codecov
Copy link

codecov bot commented Jul 21, 2022

Codecov Report

Merging #4538 (ed6eb5a) into main (ba41a92) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4538      +/-   ##
==========================================
- Coverage   90.23%   90.19%   -0.04%     
==========================================
  Files         222      222              
  Lines       41091    41092       +1     
==========================================
- Hits        37077    37063      -14     
- Misses       4014     4029      +15     
Impacted Files Coverage Δ
src/chunk.c 94.59% <100.00%> (+<0.01%) ⬆️
src/bgw/timer.c 75.00% <0.00%> (-5.56%) ⬇️
src/bgw/scheduler.c 82.89% <0.00%> (-3.25%) ⬇️
src/bgw/job.c 93.14% <0.00%> (-0.29%) ⬇️
tsl/src/nodes/data_node_dispatch.c 96.49% <0.00%> (-0.24%) ⬇️
tsl/src/bgw_policy/job.c 88.62% <0.00%> (-0.05%) ⬇️

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 ce9672a...ed6eb5a. Read the comment docs.

@svenklemm svenklemm self-assigned this Jul 22, 2022
@svenklemm svenklemm added this to the TimescaleDB 2.7.2 milestone Jul 22, 2022
When triggering chunk creation on a hypertable with non-default
statistics targets by a user different from the hypertable owner
the chunk creation will fail with a permission error. This patch
changes the chunk table creation to run the attribute modification
as the table owner.

Fixes timescale#4474
@svenklemm svenklemm merged commit 90c7c65 into timescale:main Jul 22, 2022
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Jul 22, 2022
This release is a patch release. We recommend that you upgrade at the
next available opportunity.
Among other things this release fixes several memory leaks, handling
of TOASTed values in GapFill and parameter handling in prepared statements.

**Bugfixes**

* timescale#4517 Fix prepared statement param handling in ChunkAppend
* timescale#4522 Fix ANALYZE on dist hypertable for a set of nodes
* timescale#4526 Fix gapfill group comparison for TOASTed values
* timescale#4527 Handle stats properly for range types
* timescale#4532 Fix memory leak in function telemetry
* timescale#4534 Use explicit memory context with hash_create
* timescale#4538 Fix chunk creation on hypertables with non-default statistics

**Thanks**

* @3a6u9ka, @bgemmill , @hongquani, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak
* @hleung2021 and @laocaixw  for reporting an issue with parameter handling in prepared statements
@svenklemm svenklemm mentioned this pull request Jul 22, 2022
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Jul 22, 2022
This release is a patch release. We recommend that you upgrade at the
next available opportunity.
Among other things this release fixes several memory leaks, handling
of TOASTed values in GapFill and parameter handling in prepared statements.

**Bugfixes**

* timescale#4517 Fix prepared statement param handling in ChunkAppend
* timescale#4522 Fix ANALYZE on dist hypertable for a set of nodes
* timescale#4526 Fix gapfill group comparison for TOASTed values
* timescale#4527 Handle stats properly for range types
* timescale#4532 Fix memory leak in function telemetry
* timescale#4534 Use explicit memory context with hash_create
* timescale#4538 Fix chunk creation on hypertables with non-default statistics

**Thanks**

* @3a6u9ka, @bgemmill , @hongquani, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak
* @hleung2021 and @laocaixw  for reporting an issue with parameter handling in prepared statements
svenklemm added a commit to svenklemm/timescaledb that referenced this pull request Jul 22, 2022
This release is a patch release. We recommend that you upgrade at the
next available opportunity.
Among other things this release fixes several memory leaks, handling
of TOASTed values in GapFill and parameter handling in prepared statements.

**Bugfixes**

* timescale#4517 Fix prepared statement param handling in ChunkAppend
* timescale#4522 Fix ANALYZE on dist hypertable for a set of nodes
* timescale#4526 Fix gapfill group comparison for TOASTed values
* timescale#4527 Handle stats properly for range types
* timescale#4532 Fix memory leak in function telemetry
* timescale#4534 Use explicit memory context with hash_create
* timescale#4538 Fix chunk creation on hypertables with non-default statistics

**Thanks**

* @3a6u9ka, @bgemmill, @hongquan, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak
* @hleung2021 and @laocaixw  for reporting an issue with parameter handling in prepared statements
svenklemm added a commit that referenced this pull request Jul 22, 2022
This release is a patch release. We recommend that you upgrade at the
next available opportunity.
Among other things this release fixes several memory leaks, handling
of TOASTed values in GapFill and parameter handling in prepared statements.

**Bugfixes**

* #4517 Fix prepared statement param handling in ChunkAppend
* #4522 Fix ANALYZE on dist hypertable for a set of nodes
* #4526 Fix gapfill group comparison for TOASTed values
* #4527 Handle stats properly for range types
* #4532 Fix memory leak in function telemetry
* #4534 Use explicit memory context with hash_create
* #4538 Fix chunk creation on hypertables with non-default statistics

**Thanks**

* @3a6u9ka, @bgemmill, @hongquan, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak
* @hleung2021 and @laocaixw  for reporting an issue with parameter handling in prepared statements
svenklemm added a commit that referenced this pull request Jul 22, 2022
This release is a patch release. We recommend that you upgrade at the
next available opportunity.
Among other things this release fixes several memory leaks, handling
of TOASTed values in GapFill and parameter handling in prepared statements.

**Bugfixes**

* #4517 Fix prepared statement param handling in ChunkAppend
* #4522 Fix ANALYZE on dist hypertable for a set of nodes
* #4526 Fix gapfill group comparison for TOASTed values
* #4527 Handle stats properly for range types
* #4532 Fix memory leak in function telemetry
* #4534 Use explicit memory context with hash_create
* #4538 Fix chunk creation on hypertables with non-default statistics

**Thanks**

* @3a6u9ka, @bgemmill, @hongquan, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak
* @hleung2021 and @laocaixw  for reporting an issue with parameter handling in prepared statements
svenklemm added a commit that referenced this pull request Jul 22, 2022
This release is a patch release. We recommend that you upgrade at the
next available opportunity.
Among other things this release fixes several memory leaks, handling
of TOASTed values in GapFill and parameter handling in prepared statements.

**Bugfixes**

* #4517 Fix prepared statement param handling in ChunkAppend
* #4522 Fix ANALYZE on dist hypertable for a set of nodes
* #4526 Fix gapfill group comparison for TOASTed values
* #4527 Handle stats properly for range types
* #4532 Fix memory leak in function telemetry
* #4534 Use explicit memory context with hash_create
* #4538 Fix chunk creation on hypertables with non-default statistics

**Thanks**

* @3a6u9ka, @bgemmill, @hongquan, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak
* @hleung2021 and @laocaixw  for reporting an issue with parameter handling in prepared statements
svenklemm added a commit that referenced this pull request Jul 25, 2022
This release is a patch release. We recommend that you upgrade at the
next available opportunity.
Among other things this release fixes several memory leaks, handling
of TOASTed values in GapFill and parameter handling in prepared statements.

**Bugfixes**

* #4517 Fix prepared statement param handling in ChunkAppend
* #4522 Fix ANALYZE on dist hypertable for a set of nodes
* #4526 Fix gapfill group comparison for TOASTed values
* #4527 Handle stats properly for range types
* #4532 Fix memory leak in function telemetry
* #4534 Use explicit memory context with hash_create
* #4538 Fix chunk creation on hypertables with non-default statistics

**Thanks**

* @3a6u9ka, @bgemmill, @hongquan, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak
* @hleung2021 and @laocaixw  for reporting an issue with parameter handling in prepared statements
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.

[Bug]: ERROR: must be owner of table _hyper_4_7401_chunk when using different statistics target
3 participants