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

Avoid decompressing batches using an empty slot #6117

Merged
merged 1 commit into from Sep 27, 2023

Conversation

antekresic
Copy link
Contributor

When running COPY command into a compressed hypertable, we could end up using an empty slot for filtering compressed batches. This happens when a previously created copy buffer for a chunk does not contain any new tuples for inserting. The fix is to verify slots before attempting to do anything else.

@github-actions
Copy link

@jnidzwetzki, @gayyappan: please review this pull request.

Powered by pull-review

When running COPY command into a compressed hypertable, we
could end up using an empty slot for filtering compressed batches.
This happens when a previously created copy buffer for a chunk
does not contain any new tuples for inserting. The fix is to
verify slots before attempting to do anything else.
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #6117 (19d1611) into main (d9e4a71) will decrease coverage by 0.07%.
The diff coverage is 100.00%.

❗ Current head 19d1611 differs from pull request most recent head 4a3f1ca. Consider uploading reports for the commit 4a3f1ca to get more accurate results

@@            Coverage Diff             @@
##             main    #6117      +/-   ##
==========================================
- Coverage   81.52%   81.45%   -0.07%     
==========================================
  Files         246      246              
  Lines       56781    56737      -44     
  Branches    12588    12570      -18     
==========================================
- Hits        46289    46214      -75     
- Misses       8115     8132      +17     
- Partials     2377     2391      +14     
Files Coverage Δ
tsl/src/compression/compression.c 91.46% <100.00%> (+0.01%) ⬆️

... and 20 files with indirect coverage changes

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

@@ -0,0 +1,1002 @@
generate_series,random
Copy link
Contributor

Choose a reason for hiding this comment

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

Is possible to use a small dataset?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, it needs at least 1001 rows in order to trigger this because of the sizes of copy buffers.

@antekresic antekresic merged commit 1932c02 into timescale:main Sep 27, 2023
34 checks passed
@antekresic antekresic deleted the fix-empty-buffer branch September 27, 2023 07:09
@akuzm akuzm added the bug label Oct 4, 2023
konskov added a commit to konskov/timescaledb that referenced this pull request Oct 9, 2023
This release contains bug fixes since the 2.12.0 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#6113 Fix planner distributed table count
* timescale#6117 Avoid decompressing batches using an empty slot
* timescale#6123 Fix concurrency errors in OSM API
* timescale#6142 do not throw an error when deprecation GUC cannot be read
**Thanks**
* @symbx for reporting a crash when selecting from empty hypertables
@konskov konskov mentioned this pull request Oct 9, 2023
konskov added a commit to konskov/timescaledb that referenced this pull request Oct 9, 2023
This release contains bug fixes since the 2.12.0 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#6113 Fix planner distributed table count
* timescale#6117 Avoid decompressing batches using an empty slot
* timescale#6123 Fix concurrency errors in OSM API
* timescale#6142 Do not throw an error when deprecation GUC cannot be read

**Thanks**
* @symbx for reporting a crash when selecting from empty hypertables
pallavisontakke pushed a commit to konskov/timescaledb that referenced this pull request Oct 10, 2023
This release contains bug fixes since the 2.12.0 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#6113 Fix planner distributed table count
* timescale#6117 Avoid decompressing batches using an empty slot
* timescale#6123 Fix concurrency errors in OSM API
* timescale#6142 Do not throw an error when deprecation GUC cannot be read

**Thanks**
* @symbx for reporting a crash when selecting from empty hypertables
konskov added a commit to konskov/timescaledb that referenced this pull request Oct 10, 2023
This release contains bug fixes since the 2.12.0 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#6113 Fix planner distributed table count
* timescale#6117 Avoid decompressing batches using an empty slot
* timescale#6123 Fix concurrency errors in OSM API
* timescale#6142 Do not throw an error when deprecation GUC cannot be read

**Thanks**
* @symbx for reporting a crash when selecting from empty hypertables
konskov added a commit that referenced this pull request Oct 10, 2023
This release contains bug fixes since the 2.12.0 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #6113 Fix planner distributed table count
* #6117 Avoid decompressing batches using an empty slot
* #6123 Fix concurrency errors in OSM API
* #6142 Do not throw an error when deprecation GUC cannot be read

**Thanks**
* @symbx for reporting a crash when selecting from empty hypertables
konskov added a commit to konskov/timescaledb that referenced this pull request Oct 10, 2023
This release contains bug fixes since the 2.12.0 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#6113 Fix planner distributed table count
* timescale#6117 Avoid decompressing batches using an empty slot
* timescale#6123 Fix concurrency errors in OSM API
* timescale#6142 Do not throw an error when deprecation GUC cannot be read

**Thanks**
* @symbx for reporting a crash when selecting from empty hypertables
konskov added a commit that referenced this pull request Oct 10, 2023
This release contains bug fixes since the 2.12.0 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* #6113 Fix planner distributed table count
* #6117 Avoid decompressing batches using an empty slot
* #6123 Fix concurrency errors in OSM API
* #6142 Do not throw an error when deprecation GUC cannot be read

**Thanks**
* @symbx for reporting a crash when selecting from empty hypertables
jnidzwetzki pushed a commit to jnidzwetzki/timescaledb that referenced this pull request Nov 9, 2023
This release contains bug fixes since the 2.12.0 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#6113 Fix planner distributed table count
* timescale#6117 Avoid decompressing batches using an empty slot
* timescale#6123 Fix concurrency errors in OSM API
* timescale#6142 Do not throw an error when deprecation GUC cannot be read

**Thanks**
* @symbx for reporting a crash when selecting from empty hypertables
jnidzwetzki pushed a commit to jnidzwetzki/timescaledb that referenced this pull request Nov 19, 2023
This release contains bug fixes since the 2.12.0 release.
We recommend that you upgrade at the next available opportunity.

**Bugfixes**
* timescale#6113 Fix planner distributed table count
* timescale#6117 Avoid decompressing batches using an empty slot
* timescale#6123 Fix concurrency errors in OSM API
* timescale#6142 Do not throw an error when deprecation GUC cannot be read

**Thanks**
* @symbx for reporting a crash when selecting from empty hypertables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants