Skip to content

sql/copy: deflake TestLargeCopy by enabling retries in non-atomic mode#164320

Closed
mw5h wants to merge 1 commit intocockroachdb:masterfrom
mw5h:fix-large-copy-retry
Closed

sql/copy: deflake TestLargeCopy by enabling retries in non-atomic mode#164320
mw5h wants to merge 1 commit intocockroachdb:masterfrom
mw5h:fix-large-copy-retry

Conversation

@mw5h
Copy link
Contributor

@mw5h mw5h commented Feb 25, 2026

TestLargeCopy randomly chooses between atomic and non-atomic COPY mode.
In non-atomic mode, the test disables copy_from_atomic_enabled but does
not enable copy_from_retries_enabled. This means retryable errors
(TransactionRetryWithProtoRefreshError / SQLSTATE 40001) are not handled
by the internal COPY retry mechanism, and the test's ignoreErr function
only ignores SerializationFailure in atomic mode.

Enable copy_from_retries_enabled alongside disabling atomic mode so that
the per-batch retry mechanism handles transient conflicts automatically.

Fixes: #164185
Epic: CRDB-60677
Release note: None

TestLargeCopy randomly chooses between atomic and non-atomic COPY mode.
In non-atomic mode, the test disables `copy_from_atomic_enabled` but
does not enable `copy_from_retries_enabled`. This means retryable errors
(TransactionRetryWithProtoRefreshError / SQLSTATE 40001) are not handled
by the internal COPY retry mechanism, and the test's `ignoreErr` function
only ignores SerializationFailure in atomic mode.

Enable `copy_from_retries_enabled` alongside disabling atomic mode so
that the per-batch retry mechanism handles transient conflicts
automatically.

Fixes: cockroachdb#164185

Release note: None

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@trunk-io
Copy link
Contributor

trunk-io bot commented Feb 25, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@mw5h mw5h requested review from a team and yuzefovich February 25, 2026 18:27
@mw5h mw5h marked this pull request as ready for review February 25, 2026 18:28
Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

@yuzefovich reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on mw5h).


-- commits line 6 at r1:
Looks like we have copy_from_retries_enabled and don't mutate it later, so this commit seems like a no-op to me?

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

@yuzefovich made 1 comment.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on mw5h).


-- commits line 6 at r1:

Previously, yuzefovich (Yahor Yuzefovich) wrote…

Looks like we have copy_from_retries_enabled and don't mutate it later, so this commit seems like a no-op to me?

Sorry, meant to say "Looks like we have copy_from_retries_enabled enabled by default ..."

@mw5h
Copy link
Contributor Author

mw5h commented Feb 25, 2026

Whups.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pkg/sql/copy/copy_test: TestLargeCopy failed

3 participants