Skip to content

perf(spanner): inline BeginTransaction with first query (step 1)#5320

Open
olavloite wants to merge 4 commits intogoogleapis:mainfrom
olavloite:spanner-inline-begin-tx-step-1
Open

perf(spanner): inline BeginTransaction with first query (step 1)#5320
olavloite wants to merge 4 commits intogoogleapis:mainfrom
olavloite:spanner-inline-begin-tx-step-1

Conversation

@olavloite
Copy link
Copy Markdown
Contributor

@olavloite olavloite commented Apr 8, 2026

Adds support for inlining the BeginTransaction option with the first query in a read-only transaction. This saves one round-trip to Spanner for multi-use read-only transactions.

This implementation is intentionally simple:

  1. It does not support parallel queries at the start of the transaction.
  2. It does not include error handling for the first query.
  3. It only supports read-only transactions.

This is step 1. Follow-up pull requests addresses the above points.

A preliminary view of the full implementation after all steps can be seen in #5307

See also go/spanner-rust-inline-begin-transaction

Adds support for inlining the BeginTransaction with the first query in a read-only
transaction. This saves one round-trip to Spanner for multi-use read-only transactions.

This implementation is intentionally simple:
1. It does not support parallel queries at the start of the transaction.
2. It does not include error handling for the first query.
3. It only supports read-only transactions.

This is step 1. Follow-up pull requests addresses the above points.
@olavloite olavloite requested a review from a team as a code owner April 8, 2026 06:58
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Apr 8, 2026
@olavloite olavloite force-pushed the spanner-inline-begin-tx-step-1 branch from a563896 to 57eb403 Compare April 8, 2026 07:00
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 98.03922% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.80%. Comparing base (e373f94) to head (d8af76e).

Files with missing lines Patch % Lines
src/spanner/src/read_only_transaction.rs 97.73% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5320      +/-   ##
==========================================
+ Coverage   97.79%   97.80%   +0.01%     
==========================================
  Files         220      220              
  Lines       45845    46066     +221     
==========================================
+ Hits        44832    45053     +221     
  Misses       1013     1013              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants