Repository navigation
Commit 54c0d0f
authored
fix(spanner): only set snapshot isolation read timestamp for SI or optimistic txns in CloudClientExecutor (#14346)
In `CloudClientExecutor`, `CommitResponse.getSnapshotTimestamp()` was
unconditionally populated into `SpannerActionOutcome`'s
`snapshot_isolation_txn_read_timestamp` for all committing read-write
transactions.
When a standard Serializable Pessimistic transaction executes over a
multiplexed session with reads, Cloud Spanner SpanFE records an internal
snapshot timestamp and includes it in CommitResponse. Setting
snapshot_isolation_txn_read_timestamp for non-SI/non-optimistic
transactions violates systest SpotValidator invariants, causing
validation failures with: `"Snapshot read timestamp set in a txn that's
not a snapshot isolation or optimistic txn."`
This change gates setting `snapshot_isolation_txn_read_timestamp` on
(`rwTxn.repeatableRead || rwTxn.optimistic`), ensuring the field is only
populated when the transaction actually ran with snapshot isolation or
optimistic concurrency control.1 parent d76d159 commit 54c0d0f
1 file changed
Lines changed: 2 additions & 1 deletion
File tree
- java-spanner/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
788 | 788 | | |
789 | 789 | | |
790 | 790 | | |
791 | | - | |
| 791 | + | |
| 792 | + | |
792 | 793 | | |
793 | 794 | | |
794 | 795 | | |
| |||
0 commit comments