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: transaction retries should not timeout #1009

Merged
merged 1 commit into from Mar 24, 2021
Merged

Conversation

olavloite
Copy link
Collaborator

Transactions that are retried because of an aborted transaction use the retry settings of the Rollback RPC. This ensures reasonable backoff values. It however also meant that transactions that are retried multiple times could exceed the total timeout of the retry settings, and that again would cause the Aborted error to propagate. This change sets the total timeout for transaction retries to 24 hours and disables any max attempts in the retry settings to prevent retries to fail because the deadline is exceeded.

Transactions can still fail with timeout errors if individual RPC invocations exceed the configured timeout of that RPC. This change only prevents timeouts from occurring because of repeated retries of an entire transaction.

Fixes #1008

Transactions that are retried because of an aborted transaction use the
retry settings of the Rollback RPC. This ensures reasonable backoff values.
It however also meant that transactions that are retried multiple times
could exceed the total timeout of the retry settings, and that again would
cause the Aborted error to propagate. This change sets the total timeout
for transaction retries to 24 hours and disables any max attempts in the
retry settings to prevent retries to fail because the deadline is exceeded.

Transactions can still fail with timeout errors if individual RPC invocations
exceed the configured timeout of that RPC. This change only prevents timeouts
from occurring because of repeated retries of an entire transaction.

Fixes #1008
@olavloite olavloite requested a review from a team as a code owner March 23, 2021 11:34
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Mar 23, 2021
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Mar 23, 2021
@codecov
Copy link

codecov bot commented Mar 23, 2021

Codecov Report

Merging #1009 (6e1d08f) into master (a95f6f8) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1009      +/-   ##
============================================
- Coverage     85.12%   85.11%   -0.01%     
+ Complexity     2619     2618       -1     
============================================
  Files           154      154              
  Lines         14324    14329       +5     
  Branches       1334     1334              
============================================
+ Hits          12193    12196       +3     
- Misses         1569     1570       +1     
- Partials        562      563       +1     
Impacted Files Coverage Δ Complexity Δ
...a/com/google/cloud/spanner/SpannerRetryHelper.java 84.61% <100.00%> (+3.66%) 3.00 <3.00> (ø)
...ain/java/com/google/cloud/spanner/SessionPool.java 88.93% <0.00%> (-0.20%) 71.00% <0.00%> (-1.00%)

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 a95f6f8...6e1d08f. Read the comment docs.

@olavloite olavloite merged commit 6d9c3b8 into master Mar 24, 2021
@olavloite olavloite deleted the transaction-timeout branch March 24, 2021 07:55
rajatbhatta pushed a commit to rajatbhatta/java-spanner that referenced this pull request Nov 17, 2022
…to v0.9.15 (googleapis#1009)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [org.graalvm.buildtools:junit-platform-native](https://togithub.com/graalvm/native-build-tools) | `0.9.14` -> `0.9.15` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.15/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.15/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.15/compatibility-slim/0.9.14)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.15/confidence-slim/0.9.14)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>graalvm/native-build-tools</summary>

### [`v0.9.15`](https://togithub.com/graalvm/native-build-tools/releases/tag/0.9.15)

[Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.14...0.9.15)

#### What's Changed

Read what's new in the [documentation](https://graalvm.github.io/native-build-tools/latest/index.html#changelog).

-   Move block from onTestClassRegistered to onLoad function by [@&#8203;dnestoro](https://togithub.com/dnestoro) in [https://togithub.com/graalvm/native-build-tools/pull/312](https://togithub.com/graalvm/native-build-tools/pull/312)
-   Add .sdkmanrc by [@&#8203;philwebb](https://togithub.com/philwebb) in [https://togithub.com/graalvm/native-build-tools/pull/320](https://togithub.com/graalvm/native-build-tools/pull/320)
-   Bump the default metadata repository version to 0.2.1 by [@&#8203;dnestoro](https://togithub.com/dnestoro) in [https://togithub.com/graalvm/native-build-tools/pull/323](https://togithub.com/graalvm/native-build-tools/pull/323)
-   Fix functional tests for MacOS users by [@&#8203;philwebb](https://togithub.com/philwebb) in [https://togithub.com/graalvm/native-build-tools/pull/321](https://togithub.com/graalvm/native-build-tools/pull/321)
-   Include buildtool support for bundling reachability metadata into jar files by [@&#8203;philwebb](https://togithub.com/philwebb) in [https://togithub.com/graalvm/native-build-tools/pull/322](https://togithub.com/graalvm/native-build-tools/pull/322)
-   Ship the GraalVM metadata repository as an artifact alongside NBT by [@&#8203;melix](https://togithub.com/melix) in [https://togithub.com/graalvm/native-build-tools/pull/331](https://togithub.com/graalvm/native-build-tools/pull/331)
-   Improve toolchain selection diagnostics by [@&#8203;melix](https://togithub.com/melix) in [https://togithub.com/graalvm/native-build-tools/pull/332](https://togithub.com/graalvm/native-build-tools/pull/332)
-   Bump metadata repository version by [@&#8203;melix](https://togithub.com/melix) in [https://togithub.com/graalvm/native-build-tools/pull/335](https://togithub.com/graalvm/native-build-tools/pull/335)
-   Fix ` NoSuchFileExceptionv in  `collectReachabilityMetadata\` Gradle task by [@&#8203;sdeleuze](https://togithub.com/sdeleuze) in [https://togithub.com/graalvm/native-build-tools/pull/336](https://togithub.com/graalvm/native-build-tools/pull/336)
-   Remove use of DependencyFilter by [@&#8203;melix](https://togithub.com/melix) in [https://togithub.com/graalvm/native-build-tools/pull/337](https://togithub.com/graalvm/native-build-tools/pull/337)

#### New Contributors

-   [@&#8203;philwebb](https://togithub.com/philwebb) made their first contribution in [https://togithub.com/graalvm/native-build-tools/pull/320](https://togithub.com/graalvm/native-build-tools/pull/320)

**Full Changelog**: https://togithub.com/graalvm/native-build-tools/compare/0.9.14...0.9.15

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMzcuMCIsInVwZGF0ZWRJblZlciI6IjMyLjIzNy4wIn0=-->
rajatbhatta pushed a commit to rajatbhatta/java-spanner that referenced this pull request Nov 17, 2022
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 googleapis/java-spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transaction retries could timeout and propagate the Aborted error to the client application
2 participants