Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Commit 937a7a1

Browse files
feat: Update TransactionOptions to include new option exclude_txn_from_change_streams (#1998)
* feat(spanner): add field for multiplexed session in spanner.proto docs: update comments PiperOrigin-RevId: 607015598 Source-Link: googleapis/googleapis@8e8a37d Source-Link: googleapis/googleapis-gen@0b51730 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGI1MTczMDhkY2MzOTBkMGI4MjFmOGE1ZDk4MmNiY2E5ZTU2NDAxMCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Update TransactionOptions to include new option exclude_txn_from_change_streams PiperOrigin-RevId: 607807587 Source-Link: googleapis/googleapis@d8af2d6 Source-Link: googleapis/googleapis-gen@601de71 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjAxZGU3MTdmMWUzNDJmZWFkYTdlMDFmNWRhNTI1NDY1YTU4OTBkOSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Sri Harsha CH <57220027+harshachinta@users.noreply.github.com>
1 parent ee88d04 commit 937a7a1

6 files changed

Lines changed: 165 additions & 6 deletions

File tree

protos/google/spanner/v1/spanner.proto

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,15 @@ message Session {
402402

403403
// The database role which created this session.
404404
string creator_role = 5;
405+
406+
// Optional. If true, specifies a multiplexed session. A multiplexed session
407+
// may be used for multiple, concurrent read-only operations but can not be
408+
// used for read-write transactions, partitioned reads, or partitioned
409+
// queries. Multiplexed sessions can be created via
410+
// [CreateSession][google.spanner.v1.Spanner.CreateSession] but not via
411+
// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
412+
// Multiplexed sessions may not be deleted nor listed.
413+
bool multiplexed = 6 [(google.api.field_behavior) = OPTIONAL];
405414
}
406415

407416
// The request for [GetSession][google.spanner.v1.Spanner.GetSession].
@@ -546,7 +555,7 @@ message DirectedReadOptions {
546555
// * `location:us-east1` --> The "us-east1" replica(s) of any available type
547556
// will be used to process the request.
548557
// * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in nearest
549-
// . available location will be used to process the
558+
// available location will be used to process the
550559
// request.
551560
// * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s)
552561
// in location "us-east1" will be used to process
@@ -590,8 +599,7 @@ message DirectedReadOptions {
590599
repeated ReplicaSelection replica_selections = 1;
591600
}
592601

593-
// Required. Replicas indicates the order in which replicas should be
594-
// considered. At most one of either include_replicas or exclude_replicas
602+
// Required. At most one of either include_replicas or exclude_replicas
595603
// should be present in the message.
596604
oneof replicas {
597605
// Include_replicas indicates the order of replicas (as they appear in
@@ -601,8 +609,9 @@ message DirectedReadOptions {
601609
// may fail due to `DEADLINE_EXCEEDED` errors.
602610
IncludeReplicas include_replicas = 1;
603611

604-
// Exclude_replicas indicates that should be excluded from serving
605-
// requests. Spanner will not route requests to the replicas in this list.
612+
// Exclude_replicas indicates that specified replicas should be excluded
613+
// from serving requests. Spanner will not route requests to the replicas
614+
// in this list.
606615
ExcludeReplicas exclude_replicas = 2;
607616
}
608617
}
@@ -1211,6 +1220,21 @@ message BatchWriteRequest {
12111220
// Required. The groups of mutations to be applied.
12121221
repeated MutationGroup mutation_groups = 4
12131222
[(google.api.field_behavior) = REQUIRED];
1223+
1224+
// Optional. When `exclude_txn_from_change_streams` is set to `true`:
1225+
// * Mutations from all transactions in this batch write operation will not
1226+
// be recorded in change streams with DDL option `allow_txn_exclusion=true`
1227+
// that are tracking columns modified by these transactions.
1228+
// * Mutations from all transactions in this batch write operation will be
1229+
// recorded in change streams with DDL option `allow_txn_exclusion=false or
1230+
// not set` that are tracking columns modified by these transactions.
1231+
//
1232+
// When `exclude_txn_from_change_streams` is set to `false` or not set,
1233+
// mutations from all transactions in this batch write operation will be
1234+
// recorded in all change streams that are tracking columns modified by these
1235+
// transactions.
1236+
bool exclude_txn_from_change_streams = 5
1237+
[(google.api.field_behavior) = OPTIONAL];
12141238
}
12151239

12161240
// The result of applying a batch of mutations.

protos/google/spanner/v1/transaction.proto

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -475,6 +475,22 @@ message TransactionOptions {
475475
// on the `session` resource.
476476
ReadOnly read_only = 2;
477477
}
478+
479+
// When `exclude_txn_from_change_streams` is set to `true`:
480+
// * Mutations from this transaction will not be recorded in change streams
481+
// with DDL option `allow_txn_exclusion=true` that are tracking columns
482+
// modified by these transactions.
483+
// * Mutations from this transaction will be recorded in change streams with
484+
// DDL option `allow_txn_exclusion=false or not set` that are tracking
485+
// columns modified by these transactions.
486+
//
487+
// When `exclude_txn_from_change_streams` is set to `false` or not set,
488+
// mutations from this transaction will be recorded in all change streams that
489+
// are tracking columns modified by these transactions.
490+
// `exclude_txn_from_change_streams` may only be specified for read-write or
491+
// partitioned-dml transactions, otherwise the API will return an
492+
// `INVALID_ARGUMENT` error.
493+
bool exclude_txn_from_change_streams = 5;
478494
}
479495

480496
// A transaction.

protos/protos.d.ts

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)