-
Notifications
You must be signed in to change notification settings - Fork 105
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
deleteRows transaction not atomic #336
Comments
@allenwang7, could you share the code fragment which caused this to happen? I imagine it resembles the sample code in the docstring, but I want to be sure I understand how this occurred. |
@crwilcox , something like this.
|
Would the fix here be to do some local validation and throw an error? Or is this a bug or enhancement upstream? |
/cc @snehashah16 |
There is no way to validate this in the client library. I notice the library is using the singleUse txn here. i would recommend we change it to an explicit begin txn -> buffer mutations -> commit workflow. |
I'll close this, and we can let #347 serve as the tracker for implementing transaction usage throughout the library. |
I recommend we open this bug again. This is also not a feature request. |
Environment details
@google-cloud/spanner
version: 2.0.0Steps to reproduce
nodejs-spanner/src/transaction-request.js
Lines 271 to 301 in 2b8cdda
Performed that command up above. I tried to delete around 8000 rows, each having multiple indices/keys, so it went over the 20k mutations per transaction limit. I did not realize this, and ran it. The entire transaction should fail, but it actually deleted as much as it could under the 20k limit, then threw the over 20k mutations/transaction error. Is this expected?
Thanks!
The text was updated successfully, but these errors were encountered: