google-cloud-spanner-v1 1.9.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d32b7f484a75324a2e48e1ea85e7089a8bef5da180a02e21c7e9625f464df8d
|
4
|
+
data.tar.gz: 69b64708e05b52d155712513335cd0528dfdaacf13d840a85cc1d297ef66aa4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac27fa215680bd34a8856be15499efeaab94310f870308a1ba37774694287a89e70487d8adb5138873675889a4b0d4b2166c2f8d6987293f61965acbf5ee77e1
|
7
|
+
data.tar.gz: 2cb2a34068868559764d7854514548a187534ddeed328428c7c76eab0f2b445668bc22bf7acf51890314eae7b14e2d459346b0e7caa5b4b64fde35f13f6f3659
|
@@ -8,7 +8,7 @@ require 'google/protobuf/timestamp_pb'
|
|
8
8
|
require 'google/spanner/v1/transaction_pb'
|
9
9
|
|
10
10
|
|
11
|
-
descriptor_data = "\n\'google/spanner/v1/commit_response.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a#google/spanner/v1/transaction.proto\"\
|
11
|
+
descriptor_data = "\n\'google/spanner/v1/commit_response.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a#google/spanner/v1/transaction.proto\"\xd5\x02\n\x0e\x43ommitResponse\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\x0c\x63ommit_stats\x18\x02 \x01(\x0b\x32-.google.spanner.v1.CommitResponse.CommitStats\x12N\n\x0fprecommit_token\x18\x04 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenH\x00\x12\x36\n\x12snapshot_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a%\n\x0b\x43ommitStats\x12\x16\n\x0emutation_count\x18\x01 \x01(\x03\x42\x19\n\x17MultiplexedSessionRetryB\xb6\x01\n\x15\x63om.google.spanner.v1B\x13\x43ommitResponseProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3"
|
12
12
|
|
13
13
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
14
14
|
|
@@ -27,13 +27,19 @@ module Google
|
|
27
27
|
# The Cloud Spanner timestamp at which the transaction committed.
|
28
28
|
# @!attribute [rw] commit_stats
|
29
29
|
# @return [::Google::Cloud::Spanner::V1::CommitResponse::CommitStats]
|
30
|
-
# The statistics about this Commit
|
30
|
+
# The statistics about this `Commit`. Not returned by default.
|
31
31
|
# For more information, see
|
32
32
|
# {::Google::Cloud::Spanner::V1::CommitRequest#return_commit_stats CommitRequest.return_commit_stats}.
|
33
33
|
# @!attribute [rw] precommit_token
|
34
34
|
# @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken]
|
35
35
|
# If specified, transaction has not committed yet.
|
36
|
-
#
|
36
|
+
# You must retry the commit with the new precommit token.
|
37
|
+
# @!attribute [rw] snapshot_timestamp
|
38
|
+
# @return [::Google::Protobuf::Timestamp]
|
39
|
+
# If `TransactionOptions.isolation_level` is set to
|
40
|
+
# `IsolationLevel.REPEATABLE_READ`, then the snapshot timestamp is the
|
41
|
+
# timestamp at which all reads in the transaction ran. This timestamp is
|
42
|
+
# never returned.
|
37
43
|
class CommitResponse
|
38
44
|
include ::Google::Protobuf::MessageExts
|
39
45
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -21,330 +21,7 @@ module Google
|
|
21
21
|
module Cloud
|
22
22
|
module Spanner
|
23
23
|
module V1
|
24
|
-
#
|
25
|
-
#
|
26
|
-
# Each session can have at most one active transaction at a time (note that
|
27
|
-
# standalone reads and queries use a transaction internally and do count
|
28
|
-
# towards the one transaction limit). After the active transaction is
|
29
|
-
# completed, the session can immediately be re-used for the next transaction.
|
30
|
-
# It is not necessary to create a new session for each transaction.
|
31
|
-
#
|
32
|
-
# Transaction modes:
|
33
|
-
#
|
34
|
-
# Cloud Spanner supports three transaction modes:
|
35
|
-
#
|
36
|
-
# 1. Locking read-write. This type of transaction is the only way
|
37
|
-
# to write data into Cloud Spanner. These transactions rely on
|
38
|
-
# pessimistic locking and, if necessary, two-phase commit.
|
39
|
-
# Locking read-write transactions may abort, requiring the
|
40
|
-
# application to retry.
|
41
|
-
#
|
42
|
-
# 2. Snapshot read-only. Snapshot read-only transactions provide guaranteed
|
43
|
-
# consistency across several reads, but do not allow
|
44
|
-
# writes. Snapshot read-only transactions can be configured to read at
|
45
|
-
# timestamps in the past, or configured to perform a strong read
|
46
|
-
# (where Spanner will select a timestamp such that the read is
|
47
|
-
# guaranteed to see the effects of all transactions that have committed
|
48
|
-
# before the start of the read). Snapshot read-only transactions do not
|
49
|
-
# need to be committed.
|
50
|
-
#
|
51
|
-
# Queries on change streams must be performed with the snapshot read-only
|
52
|
-
# transaction mode, specifying a strong read. Please see
|
53
|
-
# {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#strong TransactionOptions.ReadOnly.strong}
|
54
|
-
# for more details.
|
55
|
-
#
|
56
|
-
# 3. Partitioned DML. This type of transaction is used to execute
|
57
|
-
# a single Partitioned DML statement. Partitioned DML partitions
|
58
|
-
# the key space and runs the DML statement over each partition
|
59
|
-
# in parallel using separate, internal transactions that commit
|
60
|
-
# independently. Partitioned DML transactions do not need to be
|
61
|
-
# committed.
|
62
|
-
#
|
63
|
-
# For transactions that only read, snapshot read-only transactions
|
64
|
-
# provide simpler semantics and are almost always faster. In
|
65
|
-
# particular, read-only transactions do not take locks, so they do
|
66
|
-
# not conflict with read-write transactions. As a consequence of not
|
67
|
-
# taking locks, they also do not abort, so retry loops are not needed.
|
68
|
-
#
|
69
|
-
# Transactions may only read-write data in a single database. They
|
70
|
-
# may, however, read-write data in different tables within that
|
71
|
-
# database.
|
72
|
-
#
|
73
|
-
# Locking read-write transactions:
|
74
|
-
#
|
75
|
-
# Locking transactions may be used to atomically read-modify-write
|
76
|
-
# data anywhere in a database. This type of transaction is externally
|
77
|
-
# consistent.
|
78
|
-
#
|
79
|
-
# Clients should attempt to minimize the amount of time a transaction
|
80
|
-
# is active. Faster transactions commit with higher probability
|
81
|
-
# and cause less contention. Cloud Spanner attempts to keep read locks
|
82
|
-
# active as long as the transaction continues to do reads, and the
|
83
|
-
# transaction has not been terminated by
|
84
|
-
# {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} or
|
85
|
-
# {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback}. Long periods of
|
86
|
-
# inactivity at the client may cause Cloud Spanner to release a
|
87
|
-
# transaction's locks and abort it.
|
88
|
-
#
|
89
|
-
# Conceptually, a read-write transaction consists of zero or more
|
90
|
-
# reads or SQL statements followed by
|
91
|
-
# {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}. At any time before
|
92
|
-
# {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}, the client can send a
|
93
|
-
# {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback} request to abort the
|
94
|
-
# transaction.
|
95
|
-
#
|
96
|
-
# Semantics:
|
97
|
-
#
|
98
|
-
# Cloud Spanner can commit the transaction if all read locks it acquired
|
99
|
-
# are still valid at commit time, and it is able to acquire write
|
100
|
-
# locks for all writes. Cloud Spanner can abort the transaction for any
|
101
|
-
# reason. If a commit attempt returns `ABORTED`, Cloud Spanner guarantees
|
102
|
-
# that the transaction has not modified any user data in Cloud Spanner.
|
103
|
-
#
|
104
|
-
# Unless the transaction commits, Cloud Spanner makes no guarantees about
|
105
|
-
# how long the transaction's locks were held for. It is an error to
|
106
|
-
# use Cloud Spanner locks for any sort of mutual exclusion other than
|
107
|
-
# between Cloud Spanner transactions themselves.
|
108
|
-
#
|
109
|
-
# Retrying aborted transactions:
|
110
|
-
#
|
111
|
-
# When a transaction aborts, the application can choose to retry the
|
112
|
-
# whole transaction again. To maximize the chances of successfully
|
113
|
-
# committing the retry, the client should execute the retry in the
|
114
|
-
# same session as the original attempt. The original session's lock
|
115
|
-
# priority increases with each consecutive abort, meaning that each
|
116
|
-
# attempt has a slightly better chance of success than the previous.
|
117
|
-
#
|
118
|
-
# Under some circumstances (for example, many transactions attempting to
|
119
|
-
# modify the same row(s)), a transaction can abort many times in a
|
120
|
-
# short period before successfully committing. Thus, it is not a good
|
121
|
-
# idea to cap the number of retries a transaction can attempt;
|
122
|
-
# instead, it is better to limit the total amount of time spent
|
123
|
-
# retrying.
|
124
|
-
#
|
125
|
-
# Idle transactions:
|
126
|
-
#
|
127
|
-
# A transaction is considered idle if it has no outstanding reads or
|
128
|
-
# SQL queries and has not started a read or SQL query within the last 10
|
129
|
-
# seconds. Idle transactions can be aborted by Cloud Spanner so that they
|
130
|
-
# don't hold on to locks indefinitely. If an idle transaction is aborted, the
|
131
|
-
# commit will fail with error `ABORTED`.
|
132
|
-
#
|
133
|
-
# If this behavior is undesirable, periodically executing a simple
|
134
|
-
# SQL query in the transaction (for example, `SELECT 1`) prevents the
|
135
|
-
# transaction from becoming idle.
|
136
|
-
#
|
137
|
-
# Snapshot read-only transactions:
|
138
|
-
#
|
139
|
-
# Snapshot read-only transactions provides a simpler method than
|
140
|
-
# locking read-write transactions for doing several consistent
|
141
|
-
# reads. However, this type of transaction does not support writes.
|
142
|
-
#
|
143
|
-
# Snapshot transactions do not take locks. Instead, they work by
|
144
|
-
# choosing a Cloud Spanner timestamp, then executing all reads at that
|
145
|
-
# timestamp. Since they do not acquire locks, they do not block
|
146
|
-
# concurrent read-write transactions.
|
147
|
-
#
|
148
|
-
# Unlike locking read-write transactions, snapshot read-only
|
149
|
-
# transactions never abort. They can fail if the chosen read
|
150
|
-
# timestamp is garbage collected; however, the default garbage
|
151
|
-
# collection policy is generous enough that most applications do not
|
152
|
-
# need to worry about this in practice.
|
153
|
-
#
|
154
|
-
# Snapshot read-only transactions do not need to call
|
155
|
-
# {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} or
|
156
|
-
# {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback} (and in fact are not
|
157
|
-
# permitted to do so).
|
158
|
-
#
|
159
|
-
# To execute a snapshot transaction, the client specifies a timestamp
|
160
|
-
# bound, which tells Cloud Spanner how to choose a read timestamp.
|
161
|
-
#
|
162
|
-
# The types of timestamp bound are:
|
163
|
-
#
|
164
|
-
# - Strong (the default).
|
165
|
-
# - Bounded staleness.
|
166
|
-
# - Exact staleness.
|
167
|
-
#
|
168
|
-
# If the Cloud Spanner database to be read is geographically distributed,
|
169
|
-
# stale read-only transactions can execute more quickly than strong
|
170
|
-
# or read-write transactions, because they are able to execute far
|
171
|
-
# from the leader replica.
|
172
|
-
#
|
173
|
-
# Each type of timestamp bound is discussed in detail below.
|
174
|
-
#
|
175
|
-
# Strong: Strong reads are guaranteed to see the effects of all transactions
|
176
|
-
# that have committed before the start of the read. Furthermore, all
|
177
|
-
# rows yielded by a single read are consistent with each other -- if
|
178
|
-
# any part of the read observes a transaction, all parts of the read
|
179
|
-
# see the transaction.
|
180
|
-
#
|
181
|
-
# Strong reads are not repeatable: two consecutive strong read-only
|
182
|
-
# transactions might return inconsistent results if there are
|
183
|
-
# concurrent writes. If consistency across reads is required, the
|
184
|
-
# reads should be executed within a transaction or at an exact read
|
185
|
-
# timestamp.
|
186
|
-
#
|
187
|
-
# Queries on change streams (see below for more details) must also specify
|
188
|
-
# the strong read timestamp bound.
|
189
|
-
#
|
190
|
-
# See
|
191
|
-
# {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#strong TransactionOptions.ReadOnly.strong}.
|
192
|
-
#
|
193
|
-
# Exact staleness:
|
194
|
-
#
|
195
|
-
# These timestamp bounds execute reads at a user-specified
|
196
|
-
# timestamp. Reads at a timestamp are guaranteed to see a consistent
|
197
|
-
# prefix of the global transaction history: they observe
|
198
|
-
# modifications done by all transactions with a commit timestamp less than or
|
199
|
-
# equal to the read timestamp, and observe none of the modifications done by
|
200
|
-
# transactions with a larger commit timestamp. They will block until
|
201
|
-
# all conflicting transactions that may be assigned commit timestamps
|
202
|
-
# <= the read timestamp have finished.
|
203
|
-
#
|
204
|
-
# The timestamp can either be expressed as an absolute Cloud Spanner commit
|
205
|
-
# timestamp or a staleness relative to the current time.
|
206
|
-
#
|
207
|
-
# These modes do not require a "negotiation phase" to pick a
|
208
|
-
# timestamp. As a result, they execute slightly faster than the
|
209
|
-
# equivalent boundedly stale concurrency modes. On the other hand,
|
210
|
-
# boundedly stale reads usually return fresher results.
|
211
|
-
#
|
212
|
-
# See
|
213
|
-
# {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#read_timestamp TransactionOptions.ReadOnly.read_timestamp}
|
214
|
-
# and
|
215
|
-
# {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#exact_staleness TransactionOptions.ReadOnly.exact_staleness}.
|
216
|
-
#
|
217
|
-
# Bounded staleness:
|
218
|
-
#
|
219
|
-
# Bounded staleness modes allow Cloud Spanner to pick the read timestamp,
|
220
|
-
# subject to a user-provided staleness bound. Cloud Spanner chooses the
|
221
|
-
# newest timestamp within the staleness bound that allows execution
|
222
|
-
# of the reads at the closest available replica without blocking.
|
223
|
-
#
|
224
|
-
# All rows yielded are consistent with each other -- if any part of
|
225
|
-
# the read observes a transaction, all parts of the read see the
|
226
|
-
# transaction. Boundedly stale reads are not repeatable: two stale
|
227
|
-
# reads, even if they use the same staleness bound, can execute at
|
228
|
-
# different timestamps and thus return inconsistent results.
|
229
|
-
#
|
230
|
-
# Boundedly stale reads execute in two phases: the first phase
|
231
|
-
# negotiates a timestamp among all replicas needed to serve the
|
232
|
-
# read. In the second phase, reads are executed at the negotiated
|
233
|
-
# timestamp.
|
234
|
-
#
|
235
|
-
# As a result of the two phase execution, bounded staleness reads are
|
236
|
-
# usually a little slower than comparable exact staleness
|
237
|
-
# reads. However, they are typically able to return fresher
|
238
|
-
# results, and are more likely to execute at the closest replica.
|
239
|
-
#
|
240
|
-
# Because the timestamp negotiation requires up-front knowledge of
|
241
|
-
# which rows will be read, it can only be used with single-use
|
242
|
-
# read-only transactions.
|
243
|
-
#
|
244
|
-
# See
|
245
|
-
# {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#max_staleness TransactionOptions.ReadOnly.max_staleness}
|
246
|
-
# and
|
247
|
-
# {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#min_read_timestamp TransactionOptions.ReadOnly.min_read_timestamp}.
|
248
|
-
#
|
249
|
-
# Old read timestamps and garbage collection:
|
250
|
-
#
|
251
|
-
# Cloud Spanner continuously garbage collects deleted and overwritten data
|
252
|
-
# in the background to reclaim storage space. This process is known
|
253
|
-
# as "version GC". By default, version GC reclaims versions after they
|
254
|
-
# are one hour old. Because of this, Cloud Spanner cannot perform reads
|
255
|
-
# at read timestamps more than one hour in the past. This
|
256
|
-
# restriction also applies to in-progress reads and/or SQL queries whose
|
257
|
-
# timestamp become too old while executing. Reads and SQL queries with
|
258
|
-
# too-old read timestamps fail with the error `FAILED_PRECONDITION`.
|
259
|
-
#
|
260
|
-
# You can configure and extend the `VERSION_RETENTION_PERIOD` of a
|
261
|
-
# database up to a period as long as one week, which allows Cloud Spanner
|
262
|
-
# to perform reads up to one week in the past.
|
263
|
-
#
|
264
|
-
# Querying change Streams:
|
265
|
-
#
|
266
|
-
# A Change Stream is a schema object that can be configured to watch data
|
267
|
-
# changes on the entire database, a set of tables, or a set of columns
|
268
|
-
# in a database.
|
269
|
-
#
|
270
|
-
# When a change stream is created, Spanner automatically defines a
|
271
|
-
# corresponding SQL Table-Valued Function (TVF) that can be used to query
|
272
|
-
# the change records in the associated change stream using the
|
273
|
-
# ExecuteStreamingSql API. The name of the TVF for a change stream is
|
274
|
-
# generated from the name of the change stream: READ_<change_stream_name>.
|
275
|
-
#
|
276
|
-
# All queries on change stream TVFs must be executed using the
|
277
|
-
# ExecuteStreamingSql API with a single-use read-only transaction with a
|
278
|
-
# strong read-only timestamp_bound. The change stream TVF allows users to
|
279
|
-
# specify the start_timestamp and end_timestamp for the time range of
|
280
|
-
# interest. All change records within the retention period is accessible
|
281
|
-
# using the strong read-only timestamp_bound. All other TransactionOptions
|
282
|
-
# are invalid for change stream queries.
|
283
|
-
#
|
284
|
-
# In addition, if TransactionOptions.read_only.return_read_timestamp is set
|
285
|
-
# to true, a special value of 2^63 - 2 will be returned in the
|
286
|
-
# {::Google::Cloud::Spanner::V1::Transaction Transaction} message that describes the
|
287
|
-
# transaction, instead of a valid read timestamp. This special value should be
|
288
|
-
# discarded and not used for any subsequent queries.
|
289
|
-
#
|
290
|
-
# Please see https://cloud.google.com/spanner/docs/change-streams
|
291
|
-
# for more details on how to query the change stream TVFs.
|
292
|
-
#
|
293
|
-
# Partitioned DML transactions:
|
294
|
-
#
|
295
|
-
# Partitioned DML transactions are used to execute DML statements with a
|
296
|
-
# different execution strategy that provides different, and often better,
|
297
|
-
# scalability properties for large, table-wide operations than DML in a
|
298
|
-
# ReadWrite transaction. Smaller scoped statements, such as an OLTP workload,
|
299
|
-
# should prefer using ReadWrite transactions.
|
300
|
-
#
|
301
|
-
# Partitioned DML partitions the keyspace and runs the DML statement on each
|
302
|
-
# partition in separate, internal transactions. These transactions commit
|
303
|
-
# automatically when complete, and run independently from one another.
|
304
|
-
#
|
305
|
-
# To reduce lock contention, this execution strategy only acquires read locks
|
306
|
-
# on rows that match the WHERE clause of the statement. Additionally, the
|
307
|
-
# smaller per-partition transactions hold locks for less time.
|
308
|
-
#
|
309
|
-
# That said, Partitioned DML is not a drop-in replacement for standard DML used
|
310
|
-
# in ReadWrite transactions.
|
311
|
-
#
|
312
|
-
# - The DML statement must be fully-partitionable. Specifically, the statement
|
313
|
-
# must be expressible as the union of many statements which each access only
|
314
|
-
# a single row of the table.
|
315
|
-
#
|
316
|
-
# - The statement is not applied atomically to all rows of the table. Rather,
|
317
|
-
# the statement is applied atomically to partitions of the table, in
|
318
|
-
# independent transactions. Secondary index rows are updated atomically
|
319
|
-
# with the base table rows.
|
320
|
-
#
|
321
|
-
# - Partitioned DML does not guarantee exactly-once execution semantics
|
322
|
-
# against a partition. The statement will be applied at least once to each
|
323
|
-
# partition. It is strongly recommended that the DML statement should be
|
324
|
-
# idempotent to avoid unexpected results. For instance, it is potentially
|
325
|
-
# dangerous to run a statement such as
|
326
|
-
# `UPDATE table SET column = column + 1` as it could be run multiple times
|
327
|
-
# against some rows.
|
328
|
-
#
|
329
|
-
# - The partitions are committed automatically - there is no support for
|
330
|
-
# Commit or Rollback. If the call returns an error, or if the client issuing
|
331
|
-
# the ExecuteSql call dies, it is possible that some rows had the statement
|
332
|
-
# executed on them successfully. It is also possible that statement was
|
333
|
-
# never executed against other rows.
|
334
|
-
#
|
335
|
-
# - Partitioned DML transactions may only contain the execution of a single
|
336
|
-
# DML statement via ExecuteSql or ExecuteStreamingSql.
|
337
|
-
#
|
338
|
-
# - If any error is encountered during the execution of the partitioned DML
|
339
|
-
# operation (for instance, a UNIQUE INDEX violation, division by zero, or a
|
340
|
-
# value that cannot be stored due to schema constraints), then the
|
341
|
-
# operation is stopped at that point and an error is returned. It is
|
342
|
-
# possible that at this point, some partitions have been committed (or even
|
343
|
-
# committed multiple times), and other partitions have not been run at all.
|
344
|
-
#
|
345
|
-
# Given the above, Partitioned DML is good fit for large, database-wide,
|
346
|
-
# operations that are idempotent, such as deleting old rows from a very large
|
347
|
-
# table.
|
24
|
+
# Options to use for transactions.
|
348
25
|
# @!attribute [rw] read_write
|
349
26
|
# @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite]
|
350
27
|
# Transaction may write.
|
@@ -365,7 +42,7 @@ module Google
|
|
365
42
|
# Note: The following fields are mutually exclusive: `partitioned_dml`, `read_write`, `read_only`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
366
43
|
# @!attribute [rw] read_only
|
367
44
|
# @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly]
|
368
|
-
# Transaction
|
45
|
+
# Transaction does not write.
|
369
46
|
#
|
370
47
|
# Authorization to begin a read-only transaction requires
|
371
48
|
# `spanner.databases.beginReadOnlyTransaction` permission
|
@@ -374,20 +51,24 @@ module Google
|
|
374
51
|
# Note: The following fields are mutually exclusive: `read_only`, `read_write`, `partitioned_dml`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
375
52
|
# @!attribute [rw] exclude_txn_from_change_streams
|
376
53
|
# @return [::Boolean]
|
377
|
-
# When `exclude_txn_from_change_streams` is set to `true
|
378
|
-
#
|
379
|
-
#
|
380
|
-
#
|
381
|
-
#
|
382
|
-
#
|
383
|
-
#
|
54
|
+
# When `exclude_txn_from_change_streams` is set to `true`, it prevents read
|
55
|
+
# or write transactions from being tracked in change streams.
|
56
|
+
#
|
57
|
+
# * If the DDL option `allow_txn_exclusion` is set to `true`, then the
|
58
|
+
# updates
|
59
|
+
# made within this transaction aren't recorded in the change stream.
|
60
|
+
#
|
61
|
+
# * If you don't set the DDL option `allow_txn_exclusion` or if it's
|
62
|
+
# set to `false`, then the updates made within this transaction are
|
63
|
+
# recorded in the change stream.
|
384
64
|
#
|
385
65
|
# When `exclude_txn_from_change_streams` is set to `false` or not set,
|
386
|
-
#
|
387
|
-
# are tracking columns modified by these transactions.
|
388
|
-
#
|
389
|
-
#
|
390
|
-
#
|
66
|
+
# modifications from this transaction are recorded in all change streams
|
67
|
+
# that are tracking columns modified by these transactions.
|
68
|
+
#
|
69
|
+
# The `exclude_txn_from_change_streams` option can only be specified
|
70
|
+
# for read-write or partitioned DML transactions, otherwise the API returns
|
71
|
+
# an `INVALID_ARGUMENT` error.
|
391
72
|
# @!attribute [rw] isolation_level
|
392
73
|
# @return [::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel]
|
393
74
|
# Isolation level for the transaction.
|
@@ -405,8 +86,6 @@ module Google
|
|
405
86
|
# Optional. Clients should pass the transaction ID of the previous
|
406
87
|
# transaction attempt that was aborted if this transaction is being
|
407
88
|
# executed on a multiplexed session.
|
408
|
-
# This feature is not yet supported and will result in an UNIMPLEMENTED
|
409
|
-
# error.
|
410
89
|
class ReadWrite
|
411
90
|
include ::Google::Protobuf::MessageExts
|
412
91
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -416,23 +95,26 @@ module Google
|
|
416
95
|
module ReadLockMode
|
417
96
|
# Default value.
|
418
97
|
#
|
419
|
-
# * If isolation level is
|
420
|
-
#
|
421
|
-
#
|
98
|
+
# * If isolation level is
|
99
|
+
# {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ},
|
100
|
+
# then it is an error to specify `read_lock_mode`. Locking semantics
|
101
|
+
# default to `OPTIMISTIC`. No validation checks are done for reads,
|
102
|
+
# except to validate that the data that was served at the snapshot time
|
103
|
+
# is unchanged at commit time in the following cases:
|
422
104
|
# 1. reads done as part of queries that use `SELECT FOR UPDATE`
|
423
105
|
# 2. reads done as part of statements with a `LOCK_SCANNED_RANGES`
|
424
106
|
# hint
|
425
107
|
# 3. reads done as part of DML statements
|
426
|
-
# to validate that the data that was served at the snapshot time is
|
427
|
-
# unchanged at commit time.
|
428
108
|
# * At all other isolation levels, if `read_lock_mode` is the default
|
429
|
-
# value, then pessimistic read
|
109
|
+
# value, then pessimistic read locks are used.
|
430
110
|
READ_LOCK_MODE_UNSPECIFIED = 0
|
431
111
|
|
432
112
|
# Pessimistic lock mode.
|
433
113
|
#
|
434
114
|
# Read locks are acquired immediately on read.
|
435
|
-
# Semantics described only applies to
|
115
|
+
# Semantics described only applies to
|
116
|
+
# {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE}
|
117
|
+
# isolation.
|
436
118
|
PESSIMISTIC = 1
|
437
119
|
|
438
120
|
# Optimistic lock mode.
|
@@ -440,7 +122,9 @@ module Google
|
|
440
122
|
# Locks for reads within the transaction are not acquired on read.
|
441
123
|
# Instead the locks are acquired on a commit to validate that
|
442
124
|
# read/queried data has not changed since the transaction started.
|
443
|
-
# Semantics described only applies to
|
125
|
+
# Semantics described only applies to
|
126
|
+
# {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE}
|
127
|
+
# isolation.
|
444
128
|
OPTIMISTIC = 2
|
445
129
|
end
|
446
130
|
end
|
@@ -494,7 +178,7 @@ module Google
|
|
494
178
|
# Executes all reads at the given timestamp. Unlike other modes,
|
495
179
|
# reads at a specific timestamp are repeatable; the same read at
|
496
180
|
# the same timestamp always returns the same data. If the
|
497
|
-
# timestamp is in the future, the read
|
181
|
+
# timestamp is in the future, the read is blocked until the
|
498
182
|
# specified timestamp, modulo the read's deadline.
|
499
183
|
#
|
500
184
|
# Useful for large scale consistent reads such as mapreduces, or
|
@@ -548,9 +232,9 @@ module Google
|
|
548
232
|
SERIALIZABLE = 1
|
549
233
|
|
550
234
|
# All reads performed during the transaction observe a consistent snapshot
|
551
|
-
# of the database, and the transaction
|
552
|
-
# absence of conflicts between its updates and any concurrent updates
|
553
|
-
# have occurred since that snapshot. Consequently, in contrast to
|
235
|
+
# of the database, and the transaction is only successfully committed in
|
236
|
+
# the absence of conflicts between its updates and any concurrent updates
|
237
|
+
# that have occurred since that snapshot. Consequently, in contrast to
|
554
238
|
# `SERIALIZABLE` transactions, only write-write conflicts are detected in
|
555
239
|
# snapshot transactions.
|
556
240
|
#
|
@@ -584,15 +268,13 @@ module Google
|
|
584
268
|
# Example: `"2014-10-02T15:01:23.045123456Z"`.
|
585
269
|
# @!attribute [rw] precommit_token
|
586
270
|
# @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken]
|
587
|
-
# A precommit token
|
271
|
+
# A precommit token is included in the response of a BeginTransaction
|
588
272
|
# request if the read-write transaction is on a multiplexed session and
|
589
273
|
# a mutation_key was specified in the
|
590
274
|
# {::Google::Cloud::Spanner::V1::BeginTransactionRequest BeginTransaction}.
|
591
275
|
# The precommit token with the highest sequence number from this transaction
|
592
276
|
# attempt should be passed to the {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}
|
593
277
|
# request for this transaction.
|
594
|
-
# This feature is not yet supported and will result in an UNIMPLEMENTED
|
595
|
-
# error.
|
596
278
|
class Transaction
|
597
279
|
include ::Google::Protobuf::MessageExts
|
598
280
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -631,8 +313,10 @@ module Google
|
|
631
313
|
|
632
314
|
# When a read-write transaction is executed on a multiplexed session,
|
633
315
|
# this precommit token is sent back to the client
|
634
|
-
# as a part of the
|
635
|
-
#
|
316
|
+
# as a part of the {::Google::Cloud::Spanner::V1::Transaction Transaction} message in the
|
317
|
+
# {::Google::Cloud::Spanner::V1::BeginTransactionRequest BeginTransaction} response and
|
318
|
+
# also as a part of the {::Google::Cloud::Spanner::V1::ResultSet ResultSet} and
|
319
|
+
# {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} responses.
|
636
320
|
# @!attribute [rw] precommit_token
|
637
321
|
# @return [::String]
|
638
322
|
# Opaque precommit token.
|