Skip to content

Conversation

@yuzefovich
Copy link
Member

@yuzefovich yuzefovich commented Oct 31, 2025

Backport 1/1 commits from #156584 on behalf of @yuzefovich.


When we implemented the vectorized INSERT which supports COPY in some cases, we missed one condition for auto-committing the txn that is present in the regular tableWriterBase path. Namely, we need to check whether the deadline that might be set on the txn hasn't expired yet, and if it has, we shouldn't be auto-committing and should be leaving it up to the connExecutor (which will try to refresh the deadline). The impact of the bug is that often if COPY took longer than 40s (controlled via server.sqlliveness.ttl), we'd hit the txn retry error and propagate it to the client.

Fixes: #155300.

Release note (bug fix): Previously, the "atomic" COPY command (controlled via copy_from_atomic_enabled, which is true by default) could encounter RETRY_COMMIT_DEADLINE_EXCEEDED txn errors if the whole command took 1 minute or more. This was the case only when the vectorized engine was used for COPY and is now fixed.


Release justification: low-risk bug fix.

When we implemented the vectorized INSERT which supports COPY in some
cases, we missed one condition for auto-committing the txn that is
present in the regular `tableWriterBase` path. Namely, we need to check
whether the deadline that might be set on the txn hasn't expired yet,
and if it has, we shouldn't be auto-committing and should be leaving it
up to the connExecutor (which will try to refresh the deadline). The
impact of the bug is that often if COPY took longer than 40s (controlled
via `server.sqlliveness.ttl`), we'd hit the txn retry error and
propagate it to the client.

Release note (bug fix): Previously, the "atomic" COPY command
(controlled via `copy_from_atomic_enabled`, which is `true` by default)
could encounter RETRY_COMMIT_DEADLINE_EXCEEDED txn errors if the whole
command took 1 minute or more. This was the case only when the
vectorized engine was used for COPY and is now fixed.
@yuzefovich yuzefovich requested a review from a team as a code owner October 31, 2025 22:15
@yuzefovich yuzefovich force-pushed the blathers/backport-release-25.4-156584 branch from ddb43da to 5ac50f7 Compare October 31, 2025 22:15
@yuzefovich yuzefovich requested review from mgartner and removed request for a team October 31, 2025 22:15
@blathers-crl blathers-crl bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Oct 31, 2025
@blathers-crl blathers-crl bot requested review from fqazi and michae2 October 31, 2025 22:15
@blathers-crl
Copy link

blathers-crl bot commented Oct 31, 2025

Thanks for opening a backport.

Before merging, please confirm that the change does not break backwards compatibility and otherwise complies with the backport policy. Include a brief release justification in the PR description explaining why the backport is appropriate. All backports must be reviewed by the TL for the owning area. While the stricter LTS policy does not yet apply, please exercise judgment and consider gating non-critical changes behind a disabled-by-default feature flag when appropriate.

@blathers-crl blathers-crl bot added backport Label PR's that are backports to older release branches T-sql-queries SQL Queries Team labels Oct 31, 2025
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Label PR's that are backports to older release branches blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. T-sql-queries SQL Queries Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants