spanner: Intermittent error "Transaction was started in a different session" #8192
Labels
api: spanner
Issues related to the Spanner API.
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Client
Spanner
Environment
Cloud Run
Go Environment
go version go1.19.5, go1.20.1 to go1.20.4
Code
Seems to not be isolated to any particular piece of our code.
Here is an example of
cloud.google.com/go/spanner
related stack trace when we do see the error:Expected behavior
Transaction executes without error OR documentation includes information to understand and resolve this error.
Actual behavior
The following error occasionally pops up in our production environment across multiple databases/microservices in which query logic and database schema barely change.
spanner: code = "InvalidArgument", desc = "Transaction was started in a different session."
Screenshots
In our production environment, last 30 days, showing our error or warning logs when saw that error:
Additional context
We started seeing this error "Transaction was started in a different session" pop up occasionally in our production environment after upgrading to v1.44.0 in February 2023 (the first time this happened was 2023-02-12).
This appears to happen after the transaction automatically retries.
It appears to occur in our Spanner databases with higher contention, although our database usage has been higher in the past without this particular error occurring.
We cannot find any information about this new error to help us understand if this is something we can fix.
We have looked in GCP documentation as well as the client library's docs and code.
We are used to seeing and dealing with "Transaction was aborted" errors or similar, however, this new one seems different and we are still seeing those other errors.
Hoping you can help us understand what this error means.
The text was updated successfully, but these errors were encountered: