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: emit warning when read/write transaction is retried #1192

Open
olavloite opened this issue Nov 20, 2023 · 0 comments
Open

feat: emit warning when read/write transaction is retried #1192

olavloite opened this issue Nov 20, 2023 · 0 comments
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@olavloite
Copy link
Collaborator

  1. Cloud Spanner can abort any read/write transaction.
  2. PGAdapter will by default try to retry any aborted read/write transaction, unless spanner.retry_aborts_internally=false.
  3. Retrying a read/write transaction makes it seem like a single statement in that transaction took a very long time. This shows up as a large outlier when measured from outside PGAdapter, and often causes confusion during benchmarking.

Possible ways to reduce this problem is to:

  1. Turn off internal transaction retries (i.e. execute set spanner.retry_aborts_internally=false). This will cause the transaction to fail instead of being retried.
  2. Record the transaction retry using OpenTelemetry (being added in feat: add OpenTelemetry tracing #1182)
  3. Let PGAdapter emit a warning when a transaction is being retried. The client can then log this fact along with the long execution time.

This is a request to add support for point 3 above.

@olavloite olavloite added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

1 participant