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

feat: add isolation level option for disabling internal retries #327

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

olavloite
Copy link
Collaborator

Internal retries of aborted transactions is enabled by default for database/sql connections for Spanner. However, when an application or framework knows that it will retry the transaction using a retry-loop, it is more efficient to disable internal retries.

Some frameworks, such as gorm, however make this hard to achieve, as they only allow TxOptions to be used to configure the transaction, and do not give access to the underlying driver or connection.

This change adds a custom isolation level that can be used to disable internal retries of aborted transactions.

Internal retries of aborted transactions is enabled by default for
database/sql connections for Spanner. However, when an application or
framework knows that it will retry the transaction using a retry-loop,
it is more efficient to disable internal retries.

Some frameworks, such as gorm, however make this hard to achieve, as
they only allow TxOptions to be used to configure the transaction, and
do not give access to the underlying driver or connection.

This change adds a custom isolation level that can be used to disable
internal retries of aborted transactions.
@olavloite olavloite requested a review from a team as a code owner November 18, 2024 13:19
@olavloite olavloite merged commit 118a177 into main Nov 22, 2024
17 checks passed
@olavloite olavloite deleted the option-disable-retry-aborts branch November 22, 2024 14:22
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