Skip to content

Conversation

@olavloite
Copy link

When executing batchDml statements, it is possible that the transaction is aborted by Spanner for one of the statements. This used to throw a SpannerBatchUpdateException, which would cause the transaction to fail, while the appropriate exception is AbortedException to trigger a retry of the transaction.

When executing batchDml statements, it is possible that the transaction
is aborted by Spanner for one of the statements. This used to throw a
SpannerBatchUpdateException, which would cause the transaction to fail,
while the appropriate exception is AbortedException to trigger a retry
of the transaction.
@olavloite olavloite requested a review from a team as a code owner April 16, 2019 12:09
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 16, 2019
@codecov
Copy link

codecov bot commented Apr 16, 2019

Codecov Report

Merging #4955 into master will decrease coverage by 0.37%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4955      +/-   ##
============================================
- Coverage     50.36%   49.98%   -0.38%     
- Complexity    23665    23668       +3     
============================================
  Files          2233     2238       +5     
  Lines        225856   226007     +151     
  Branches      24956    24191     -765     
============================================
- Hits         113742   112974     -768     
- Misses       103517   103693     +176     
- Partials       8597     9340     +743
Impacted Files Coverage Δ Complexity Δ
...va/com/google/cloud/compute/v1/InstanceClient.java 48.95% <0%> (-6.46%) 139% <0%> (ø)
...oogle/cloud/firestore/v1/FirestoreAdminClient.java 58.26% <0%> (-6.34%) 38% <0%> (+2%)
...ava/com/google/cloud/compute/v1/ProjectClient.java 51.14% <0%> (-5.94%) 55% <0%> (ø)
...ava/com/google/cloud/compute/v1/NetworkClient.java 49.63% <0%> (-5.84%) 35% <0%> (ø)
...ava/com/google/cloud/compute/v1/LicenseClient.java 50.41% <0%> (-5.79%) 31% <0%> (ø)
.../com/google/cloud/compute/v1/RegionDiskClient.java 48.92% <0%> (-5.76%) 35% <0%> (ø)
...va/com/google/cloud/compute/v1/SnapshotClient.java 50% <0%> (-5.74%) 31% <0%> (ø)
.../java/com/google/cloud/compute/v1/ImageClient.java 49.04% <0%> (-5.74%) 43% <0%> (ø)
.../google/cloud/compute/v1/TargetSslProxyClient.java 48.57% <0%> (-5.72%) 35% <0%> (ø)
.../google/cloud/compute/v1/SecurityPolicyClient.java 48.1% <0%> (-5.7%) 39% <0%> (ø)
... and 154 more

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 3c8c8d6...092d3e8. Read the comment docs.

exception = e;
updateCount = e.getUpdateCounts();
}
if (status == Code.ABORTED_VALUE) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there anyway to move the asserts into batchDmlAborted and batchDmlFailedPrecondition?

@kolea2
Copy link
Contributor

kolea2 commented Apr 19, 2019

@olavloite LGTM after running code formatting

@sduskis sduskis merged commit 20bc33f into googleapis:master Apr 19, 2019
@olavloite olavloite deleted the spanner-aborted-batch-dml branch April 20, 2019 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants