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

Cloud Spanner Client should prevent nested transactions #528

Closed
vkedia opened this issue Jun 6, 2017 · 4 comments
Closed

Cloud Spanner Client should prevent nested transactions #528

vkedia opened this issue Jun 6, 2017 · 4 comments
Assignees
Labels
api: spanner Issues related to the Spanner API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Comments

@vkedia
Copy link

vkedia commented Jun 6, 2017

Cloud Spanner does not support nested transactions. But the client library does allow users to call Database.runTransaction inside of the callback that is provided to an outer Database.runTransaction. This is misleading since users might believe that this will behave like a nested transaction but in reality these will be two independent transactions. This is confusing and a source of bugs. Specifically the inner transaction might succeed while the outer might ABORT, in which case the callback will be rerun thus rerunning the inner transaction.
We should prevent this from happening by detecting and raising an error if someone calls Database.runTransaction inside the callback provided to Database.runTransaction. Note that this needs to be done before Beta since this is a known breaking change.
Also note that if we come across a use case where we do want to allow calling a nested runTransaction, we should be able to enable that in future without making a breaking change.

cc @jgeewax @bjwatson

@vkedia vkedia added api: spanner Issues related to the Spanner API. priority: p0 Highest priority. Critical issue. P0 implies highest priority. labels Jun 6, 2017
@michaelbausor michaelbausor added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. and removed priority: p0 Highest priority. Critical issue. P0 implies highest priority. labels Jun 20, 2017
@michaelbausor
Copy link
Contributor

GA-blocking issues shouldn't be marked P0; P0 is for issues where the latest release is DOA. Downgrading to P1. (As per googleapis/google-cloud-java#2117)

@vkedia
Copy link
Author

vkedia commented Jun 20, 2017

For PHP this is Beta blocking since this is a breaking change in the interface.

@michaelbausor
Copy link
Contributor

Yes, sorry. I didn't mean to imply that this was not a beta blocking issue - I should have said release-blocking rather than GA-blocking.

@bjwatson
Copy link

👍

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. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.
Projects
None yet
Development

No branches or pull requests

4 participants