Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go spanner wrapper not backwards-compatible with spanner driver wrt session management in aborted transactions #11300

Open
epot opened this issue Dec 17, 2024 · 2 comments
Assignees
Labels
api: spanner Issues related to the Spanner API. triage me I really want to be triaged.

Comments

@epot
Copy link

epot commented Dec 17, 2024

Client

Spanner

Environment

Alpine Docker on GKE
go 1.23.3

Code and Dependencies

package main

func main() {
  // this is using cirello.io/dynamolock/[email protected] library
  lock, err := l.lockClient.AcquireLockWithContext(
	ctx, "test",
	dynamolock.WithAdditionalTimeToWaitForLock(l.leasePeriod),
	dynamolock.WithData([]byte(l.selfValue)),
	dynamolock.ReplaceData())
}
go.mod
module modname

go 1.23.0

require (
	github.com/googleapis/go-sql-spanner v1.7.4
	cloud.google.com/go/spanner v1.73.0
...
)

Expected behavior

It has been working fine for a long time.

Actual behavior

We started to see a few panics since we upgraded the client from v1.70.0 to v1.73.0.

Screenshots

Screenshot 2024-12-17 at 09 44 57

Additional context

It seems strangely familiar with #10385, I wonder if another regression was introduced?

@epot epot added the triage me I really want to be triaged. label Dec 17, 2024
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Dec 17, 2024
@ella-chao
Copy link

So what we found is that go-sql-spanner v1.7.4 is incompatible with spanner v1.73.0 with regards to session handling for aborted transactions.

The screenshot above shows that the transaction was aborted and rollback is called, which eventually accesses the session handle here. However, the session handle has already been nullified here.

We are upgrading go-sql-spanner to v1.9.0 to pick up this change which will create another session handle, but wanted to get your thoughts on this as the PR that introduced the session handle nullification mentioned session reuse for aborted transactions.

@epot epot changed the title spanner: nil reference in session code go spanner wrapper not backwards-compatible with spanner driver wrt session management in aborted transactions Dec 20, 2024
@epot
Copy link
Author

epot commented Dec 20, 2024

I updated the title following Ella's findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants