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

[nexus] Use retryable transactions more extensively #7212

Merged
merged 1 commit into from
Dec 6, 2024
Merged

Conversation

smklein
Copy link
Collaborator

@smklein smklein commented Dec 6, 2024

This PR finds spots where we use transaction_async and makes them use transaction_retry_wrapper instead.

This means that under contention, we'll avoid wasting work, and can make use of CockroachDB's automated retry mechanisms.

Additionally, this PR adds a clippy lint to help future usage avoid the "non-retryable" transaction variant.
There are some use cases where avoiding retries is still reasonable:

  1. Test-only code
  2. Transactions which have truly minimal contention, or which can fail with serialization errors without issue
  3. Nested transactions

@smklein smklein requested a review from bnaecker December 6, 2024 02:22
Copy link
Collaborator

@bnaecker bnaecker left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for converting these! A few small suggestions, merge at your discretion. Thanks!

@smklein smklein merged commit 9b662ea into main Dec 6, 2024
16 checks passed
@smklein smklein deleted the retry_wrapper branch December 6, 2024 20:15
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.

2 participants