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 in 1-step integer policy creation #5912

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

konskov
Copy link
Contributor

@konskov konskov commented Aug 1, 2023

Previously when a retention policy existed on the underlying hypertable,
we would get a segmentation fault when trying to add a Cagg refresh
policy, due to passing a bool instead of pointer to bool argument to
function ts_jsonb_get_int64_field in a particular code path.
Fixed by passing the expected pointer type.

Fixes #5907

@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #5912 (bdba699) into main (b2773aa) will increase coverage by 7.56%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #5912      +/-   ##
==========================================
+ Coverage   79.49%   87.06%   +7.56%     
==========================================
  Files         243      243              
  Lines       49131    55817    +6686     
  Branches    12318    12355      +37     
==========================================
+ Hits        39059    48595    +9536     
- Misses       4226     4885     +659     
+ Partials     5846     2337    -3509     
Files Changed Coverage Δ
tsl/src/bgw_policy/policies_v2.c 93.63% <100.00%> (+8.27%) ⬆️

... and 222 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@konskov konskov force-pushed the policies_fix_5907 branch 2 times, most recently from 6c32d92 to fd0c735 Compare August 1, 2023 09:23
@konskov konskov marked this pull request as ready for review August 1, 2023 09:31
@github-actions
Copy link

github-actions bot commented Aug 1, 2023

@sb230132, @shhnwz: please review this pull request.

Powered by pull-review

@konskov konskov requested review from RafiaSabih and nikkhils and removed request for sb230132 and shhnwz August 1, 2023 09:35
@RafiaSabih
Copy link
Contributor

I'd request to put more details in the commit message explaining what went wrong and how it is fixed.

ereport(ERROR,
(errcode(ERRCODE_INTERNAL_ERROR),
errmsg("could not find %s in config for job",
POL_RETENTION_CONF_KEY_DROP_AFTER)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add some comments explaining why this is required.

@@ -630,3 +630,18 @@ SELECT * FROM deals_best_daily ORDER BY bucket LIMIT 2;
-- expect to get an up-to-date notice
CALL refresh_continuous_aggregate('deals_best_weekly', '2022-04-24', '2022-05-05');
SELECT * FROM deals_best_weekly;

-- github issue 5907
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of mentioning issue number, it will be better if we mention what is being tested here exactly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a line about what this test is meant to check

@konskov konskov force-pushed the policies_fix_5907 branch 2 times, most recently from 725c4bb to ffaae7a Compare August 1, 2023 12:06
@konskov konskov changed the title Fix crash when adding 1-step integer retention policy Fix crash in 1-step integer policy creation Aug 1, 2023
Previously when a retention policy existed on the underlying hypertable,
we would get a segmentation fault when trying to add a Cagg refresh
policy, due to passing a bool instead of pointer to bool argument to
function `ts_jsonb_get_int64_field` in a particular code path.
Fixed by passing the expected pointer type.

Fixes timescale#5907
@konskov konskov merged commit 28612eb into timescale:main Aug 2, 2023
35 checks passed
@konskov konskov modified the milestones: 2.11.2, TimescaleDB 2.11.2 Aug 3, 2023
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.0 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks
* timescale#5923 Feature flags for TimescaleDB features
**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation
**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks
* timescale#5923 Feature flags for TimescaleDB features
**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation
**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
@konskov konskov mentioned this pull request Aug 9, 2023
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* #5923 Feature flags for TimescaleDB features

**Bugfixes**
* #5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* #5774 Fixed two bugs in decompression sorted merge code
* #5786 Ensure pg_config --cppflags are passed
* #5906 Fix quoting owners in sql scripts.
* #5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 10, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 10, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit that referenced this pull request Aug 10, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* #5923 Feature flags for TimescaleDB features

**Bugfixes**
* #5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* #5774 Fixed two bugs in decompression sorted merge code
* #5786 Ensure pg_config --cppflags are passed
* #5906 Fix quoting owners in sql scripts.
* #5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
svenklemm pushed a commit that referenced this pull request Aug 15, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* #5923 Feature flags for TimescaleDB features

**Bugfixes**
* #5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* #5774 Fixed two bugs in decompression sorted merge code
* #5786 Ensure pg_config --cppflags are passed
* #5906 Fix quoting owners in sql scripts.
* #5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit that referenced this pull request Aug 16, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* #5923 Feature flags for TimescaleDB features

**Bugfixes**
* #5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* #5774 Fixed two bugs in decompression sorted merge code
* #5786 Ensure pg_config --cppflags are passed
* #5906 Fix quoting owners in sql scripts.
* #5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants