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

kvcoord: fix flake in TestTransactionUnexpectedlyCommitted #111090

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

AlexTalks
Copy link
Contributor

@AlexTalks AlexTalks commented Sep 21, 2023

The TestTransactionUnexpectedlyCommitted/recovery_after_transfer_lease test, introduced to test #107658, has been flaky (particularly under deadlock builds) due to a race condition between a retry of a write and intent resolution. While both orderings in this test result in a correct AmbiguousResultError for the client, when intent resolution wins the race, the retried write will attempt to push away the current lockholder; since it is illegal for a committed transaction to perform a
push, this results in a different secondary error attached to the AmbiguousResultError. This change ensures a predefined ordering of these operations so that the secondary error is consistent across runs of the test.

Fixes: #110187

Release note: None

@AlexTalks AlexTalks requested a review from a team as a code owner September 21, 2023 23:46
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@AlexTalks AlexTalks changed the title kvcoord: fix flake in TestTransactionUnexpectedlyCommitted. kvcoord: fix flake in TestTransactionUnexpectedlyCommitted Sep 21, 2023
@AlexTalks AlexTalks force-pushed the fix_ambiguous_test_deadlock branch from 82240b8 to 663bda8 Compare September 21, 2023 23:47
@AlexTalks
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 22, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Sep 22, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Sep 22, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Sep 23, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Sep 23, 2023

Build failed:

The `TestTransactionUnexpectedlyCommitted/recovery_after_transfer_lease`
test, introduced to test cockroachdb#107658, has been flaky (particularly under
deadlock builds) due to a race condition between a retry of a write and
intent resolution. While both orderings in this test result in a correct
`AmbiguousResultError` for the client, when intent resolution wins the
race, the retried write will attempt to push away the current
lockholder; since it is illegal for a committed transaction to perform a
push, this results in a different secondary error attached to the
`AmbiguousResultError`. This change ensures a predefined ordering of
these operations so that the secondary error is consistent across runs
of the test.

Fixes: cockroachdb#110187

Release note: None
@AlexTalks
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 27, 2023

Build succeeded:

@craig craig bot merged commit f085187 into cockroachdb:master Sep 27, 2023
@AlexTalks AlexTalks deleted the fix_ambiguous_test_deadlock branch September 29, 2023 18:04
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.

kv/kvclient/kvcoord: TestTransactionUnexpectedlyCommitted failed
4 participants