feat(spanner): support read-only BeginTransaction request options#5785
feat(spanner): support read-only BeginTransaction request options#5785olavloite wants to merge 3 commits into
Conversation
Adds support for setting GAX request options for the BeginTransaction RPC call for read-only transactions. These options are only used if the transaction uses the ExplicitBegin transaction option. Updates googleapis#4972
There was a problem hiding this comment.
Code Review
This pull request introduces configuration options (attempt timeout, retry policy, and backoff policy) for the BeginTransaction RPC in read-only transactions. The review feedback highlights a critical regression where initializing these options to a default value by default causes the fallback mechanism to discard custom query-level options. The reviewer suggests changing the options field to an Option type initialized to None, lazily initializing it only when explicitly configured, and updating the corresponding tests.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5785 +/- ##
==========================================
+ Coverage 97.88% 97.89% +0.01%
==========================================
Files 226 226
Lines 56465 56801 +336
==========================================
+ Hits 55273 55608 +335
- Misses 1192 1193 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces configuration options for the BeginTransaction RPC in read-only transactions, allowing users to customize attempt timeouts, retry policies, and backoff policies. A review comment points out that when custom transaction-level options are configured, they completely overwrite statement-specific fallback options (such as custom timeouts) instead of merging with them. The reviewer suggests merging the options to avoid discarding statement-specific configurations.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to configure custom request options (such as attempt timeouts, retry policies, and backoff policies) specifically for the BeginTransaction RPC in read-only transactions. It adds builder methods to MultiUseReadOnlyTransactionBuilder to set these options, merges them with statement-level options during fallback explicit begins, and includes comprehensive unit tests to verify the behavior. There are no review comments to address, and the implementation is clean, well-tested, and adheres to the repository's style guidelines.
1f3c34b to
3b7e5d1
Compare
Adds support for setting GAX request options for the BeginTransaction RPC call for read-only transactions. These options are only used if the transaction uses the ExplicitBegin transaction option.
Updates #4972