GoogleCloudPlatform / GoogleCloudPlatform/pgadapter

feat: emit warning when read/write transaction is retried

Open
#1,192 0 comments 0 reactions 0 assignees View on GitHub
type: feature request
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.