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
Fixed two bugs in decompression sorted merge code #5774
Merged
jnidzwetzki
merged 1 commit into
timescale:main
from
jnidzwetzki:fix_sorted_merge_sqlsmith
Jun 12, 2023
Merged
Fixed two bugs in decompression sorted merge code #5774
jnidzwetzki
merged 1 commit into
timescale:main
from
jnidzwetzki:fix_sorted_merge_sqlsmith
Jun 12, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jnidzwetzki
changed the title
Fix two bugs in decompression sorted merge code
Fixed two bugs in decompression sorted merge code
Jun 12, 2023
jnidzwetzki
force-pushed
the
fix_sorted_merge_sqlsmith
branch
from
June 12, 2023 14:15
ed3d3f3
to
e85bc69
Compare
SQLSmith found two bugs in the compression sorted merge code. * The unused_batch_states are not initialized properly. Therefore, non-existing unused batch states can be part of the BMS. This patch fixes the initialization. * For performance reasons, We reuse the same TupleDesc across all TupleTableSlots. PostgreSQL sometimes uses TupleDesc data structures with active reference counting. The way we use the TupleDesc structures collides with the reference counting of PostgreSQL. This patch introduces a private TupleDesc copy without reference counting.
jnidzwetzki
force-pushed
the
fix_sorted_merge_sqlsmith
branch
from
June 12, 2023 14:16
e85bc69
to
48d8ce1
Compare
Codecov Report
@@ Coverage Diff @@
## main #5774 +/- ##
==========================================
+ Coverage 80.39% 87.86% +7.47%
==========================================
Files 239 239
Lines 48760 55478 +6718
Branches 12220 12287 +67
==========================================
+ Hits 39199 48745 +9546
- Misses 4187 4837 +650
+ Partials 5374 1896 -3478
... and 222 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
svenklemm
approved these changes
Jun 12, 2023
akuzm
approved these changes
Jun 12, 2023
Automated backport to 2.11.x not done: cherry-pick failed. Git status
|
timescale-automation
added
the
auto-backport-not-done
Automated backport of this PR has failed non-retriably (e.g. conflicts)
label
Jul 18, 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
Merged
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
Labels
auto-backport-not-done
Automated backport of this PR has failed non-retriably (e.g. conflicts)
backported-2.11.x
bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SQLSmith found two bugs in the compression sorted merge code.
The unused_batch_states are not initialized properly. Therefore, non-existing unused batch states can be part of the BMS. This patch fixes the initialization.
For performance reasons, We reuse the same TupleDesc across all TupleTableSlots. PostgreSQL sometimes uses TupleDesc data structures with active reference counting. The way we use the TupleDesc structures collides with the reference counting of PostgreSQL. This patch introduces a private TupleDesc copy without reference counting.
Link to failed SQLSmith run: https://github.com/timescale/timescaledb/actions/runs/5233117820/jobs/9448359165