GoogleCloudPlatform / GoogleCloudPlatform/pgadapter
feat: emit warning when read/write transaction is retried
- Dominant language
- Java
- Stars
- 91
- Forks
- 33
- Avg merge
- 3d 57m
- Merged PRs (30d)
- 58
Description
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 #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.
Contributor guide
Assessment
This issue has not been assessed yet.