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

fix: retry transactions that fail with expired transaction IDs #1347

Merged
merged 2 commits into from
Nov 2, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Oct 28, 2020

Fixes b/171204289

The original issue is that once a transaction expires, the backend returns INVALID_ARGUMENT. While INVALID_ARGUMENT is not generally retryable, we want to retry INVALID_ARGUMENT for expired transactions only. After talking with the backend TL, we decided that we can only do this based on the error message and if we have previously received a transaction ID.

This PR also changes the Rollback RPC to use the same retry semantics.

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 28, 2020
@codecov
Copy link

codecov bot commented Oct 28, 2020

Codecov Report

Merging #1347 into master will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1347      +/-   ##
==========================================
+ Coverage   98.49%   98.54%   +0.04%     
==========================================
  Files          32       32              
  Lines       19109    19115       +6     
  Branches     1370     1373       +3     
==========================================
+ Hits        18822    18836      +14     
+ Misses        284      276       -8     
  Partials        3        3              
Impacted Files Coverage Δ
dev/src/transaction.ts 98.53% <100.00%> (+1.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8717bf2...5339fb7. Read the comment docs.

@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/nodejs-firestore API. label Oct 31, 2020
Copy link
Contributor

@wilhuff wilhuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants