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

Backport to 2.15.x: #6931: Do not decompress batches for COPY with potentially invalid slot #6946

Merged
merged 1 commit into from
May 25, 2024

Conversation

timescale-automation
Copy link

This is an automated backport of #6931: Do not decompress batches for COPY with potentially invalid slot.
The original issue is #6540.
This PR will be merged automatically after all the relevant CI checks pass. If this fix should not be backported, or will be backported manually, just close this PR. You can use the backport branch to add your changes, it won't be modified automatically anymore.

For more details, please see the documentation

Original description

Do not decompress batches for COPY with potentially invalid slot

We don't have to decompress anything more when we re-lookup the chunk insert state on COPY buffer flush. Moreover, ChunkInsertState.slots[0] is incorrect slot type for decompress_batches_for_insert(), because it is a chunk slot, not a hypertable slot. This can lead to rare errors when the chunk insert states go out of cache.

Just don't do this unnecessary lookup, and move decompression to a separate function for clarity. Add an assertion and test that detect the slot type mismatch on main.

There was a related fix that improved the situation for empty copy buffers, but not for wrong slot type #6117

Fixes #6540

@timescale-automation timescale-automation added the is-auto-backport PR created by backport automation label May 23, 2024
@timescale-automation timescale-automation enabled auto-merge (rebase) May 23, 2024 09:04
We don't have to decompress anything more when we re-lookup the chunk
insert state on COPY buffer flush. Moreover, `ChunkInsertState.slots[0]`
is incorrect slot type for `decompress_batches_for_insert()`, because it
is a chunk slot, not a hypertable slot. This can lead to rare errors
when the chunk insert states go out of cache.

Just don't do this unnecessary lookup, and move decompression to a
separate function for clarity. Add an assertion and test that detect the
slot type mismatch on main.

(cherry picked from commit 044322b)
@timescale-automation timescale-automation merged commit 71521e2 into 2.15.x May 25, 2024
34 checks passed
@timescale-automation timescale-automation deleted the backport/2.15.x/6931 branch May 25, 2024 20:29
@pallavisontakke pallavisontakke added this to the TimescaleDB 2.15.1 milestone May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-auto-backport PR created by backport automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants