feat: add support for retrying aborted partitioned DML statements by larkee · Pull Request #66 · googleapis/python-spanner · GitHub
Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

feat: add support for retrying aborted partitioned DML statements#66

Merged
larkee merged 4 commits into
googleapis:masterfrom
larkee:retry-pdml
May 4, 2020
Merged

feat: add support for retrying aborted partitioned DML statements#66
larkee merged 4 commits into
googleapis:masterfrom
larkee:retry-pdml

Conversation

@larkee

@larkee larkee commented Apr 24, 2020

Copy link
Copy Markdown
Contributor

Partitioned DML transactions can be aborted by Cloud Spanner. These transactions were not automatically retried by the client library. This PR adds support for automatically retrying aborted partitioned DML statements.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 24, 2020

@busunkim96 busunkim96 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Usage of api_core's retry looks good to me.

Just to check (I'm not at familiar with the Spanner library), this retries the whole transaction?

https://aip.dev/194#generally-non-retryable-codes

ABORTED: This code typically means that the request failed due to a sequencer check failure or transaction abort. These should not be retried for an individual request; they should be retried at a level higher (the entire transaction, for example).

@larkee

larkee commented Apr 28, 2020

Copy link
Copy Markdown
Contributor Author

@skuruppu skuruppu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks reasonable but it would be good to add a description to this PR to explain why this came about.

Also, the retry logic in run_in_transaction looks quite different. It takes the retry config into account and does exponential backoff. Will this method of retrying take this config into account?

@larkee

larkee commented Apr 29, 2020

Copy link
Copy Markdown
Contributor Author

@larkee larkee marked this pull request as ready for review April 30, 2020 05:24
@larkee larkee requested a review from skuruppu April 30, 2020 05:29

@hengfengli hengfengli left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM.

@larkee larkee merged commit 8a3d700 into googleapis:master May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants