feat(spanner): add a priority setter to BatchDmlBuilder#6047
Merged
Conversation
fornwall
force-pushed
the
up-4-batch-dml-priority
branch
from
July 14, 2026 12:49
5d4df12 to
5242419
Compare
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a set_priority method to BatchDmlBuilder in src/spanner/src/batch_dml.rs to allow setting the RPC priority for batch DML requests, along with a corresponding unit test. The reviewer suggested adding a doctest example to the new public method to align with the repository style guide and maintain consistency with other builder methods.
ExecuteBatchDmlRequest.request_options carries an RPC priority, and BatchDmlBuilder already stores Option<RequestOptions> (populated by set_request_tag), but there was no way to set the priority on a batch DML request. Add BatchDmlBuilder::set_priority, mirroring StatementBuilder::set_priority, so callers can apply a request priority to the ExecuteBatchDml RPC. Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
fornwall
force-pushed
the
up-4-batch-dml-priority
branch
from
July 14, 2026 12:52
5242419 to
08f901e
Compare
olavloite
approved these changes
Jul 16, 2026
Contributor
|
/gcbrun |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6047 +/- ##
=======================================
Coverage 97.02% 97.02%
=======================================
Files 253 253
Lines 63547 63565 +18
=======================================
+ Hits 61655 61673 +18
Misses 1892 1892 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
coryan
approved these changes
Jul 16, 2026
fornwall
added a commit
to fornwall/adbc-spanner
that referenced
this pull request
Jul 17, 2026
…, UP-5, SPAN-8) (#355) Two upstream asks landed in google-cloud-rust, so bump the family pin to `5c1fe131` (main) and adopt both: - UP-4 / googleapis/google-cloud-rust#6047 added `BatchDmlBuilder::set_priority`. `RequestConfig::apply_to_batch_dml` now applies the priority alongside the request tag, so `spanner.request.priority` reaches the `ExecuteBatchDml` RPC that carries every plain autocommit DML statement — previously the batch went out `PRIORITY_UNSPECIFIED` while only its commit honoured the caller's choice. That closes SPAN-8, which existed solely as the driver-side record of the gap. - UP-5 / googleapis/google-cloud-rust#6073 added `set_priority`, `set_transaction_tag` and `set_exclude_txn_from_change_streams` to `BatchWriteTransactionBuilder`. The new `RequestConfig::apply_to_batch_write` applies the first two to the `spanner.ingest.batch_write` firehose path. `spanner.request.tag` stays off it deliberately — Spanner ignores per-request tags on BatchWrite, which is why the builder exposes no setter for it — and `max_commit_delay` / `commit_stats` still do not apply, since BatchWrite carries no per-request commit options. `exclude_txn_from_change_streams` stays unexposed: it is the SPAN-9 wishlist option, now unblocked. Two wire tests in `tests/mock_spanner.rs` pin the request options as sent, including the BatchWrite request-tag negative; both were checked non-vacuous by reverting the wiring. Docs updated where they recorded the old limitations (`src/request.rs` module doc, `OPTION_INGEST_BATCH_WRITE`, docs/options.md, README.md, CLAUDE.md). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ExecuteBatchDmlRequest.request_optionscarries an RPC priority, andBatchDmlBuilderalready storesOption<RequestOptions>(populated byset_request_tag), but there was no way to set the priority on a batch DML request.Add
BatchDmlBuilder::set_priority, mirroringStatementBuilder::set_priority, so callers can apply a request priority to theExecuteBatchDmlRPC.