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 #2117

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

Cloud Spanner Client should prevent nested transactions #2117

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. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

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 DatabaseClient.readWriteTransaction().run() inside of the callback that is provided to an outer DatabaseClient.readWriteTransaction().run(). 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 DatabaseClient.readWriteTransaction().run() inside the callback provided to DatabaseClient.readWriteTransaction().run(). Note that this needs to be done before GA 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 run, 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
@vkedia vkedia self-assigned this Jun 6, 2017
@garrettjonesgoogle
Copy link
Member

GA-blocking issues shouldn't be marked P0; P0 is for issues where the latest release is DOA. Downgrading to P1.

@garrettjonesgoogle garrettjonesgoogle 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
@garrettjonesgoogle garrettjonesgoogle added breaking change type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jul 17, 2017
@bjwatson
Copy link

@vkedia @garrettjonesgoogle I added the Release Blocking label to ensure this is fixed before GA.

@vkedia vkedia assigned snehashah16 and unassigned vkedia Sep 12, 2017
@bjwatson
Copy link

FYI @anthmgoogle and @lukesneeringer

@yihanzhen
Copy link
Contributor

This has been added to our feature backlog: https://github.com/GoogleCloudPlatform/google-cloud-java/wiki/Feature-backlog . This issue will be closed but is linked in the backlog and can continue to be used for comment and discussion.

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. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

5 participants