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(NODE-3711): retry txn end on retryable write #3047

Merged
merged 1 commit into from
Dec 1, 2021
Merged

Conversation

durran
Copy link
Member

@durran durran commented Nov 18, 2021

This is a backport of NODE-3711 to 3.7

Description

The driver was retrying commitTransaction and abortTransaction but previously failing 4 spec tests that were tricking the driver to base retries on these commands on error code. The retryable writes spec defines the specific errors that are retryable, and the transactions spec states these 2 commands must adhere to that specification. The fact that an operation is retryable is stated as:

When connected to a MongoDB instance that supports retryable writes (versions 3.6+), the driver MUST treat all errors with the RetryableWriteError label as retryable.

Note that the ticket was scoped to these two commands only, so the full gambit of retryable writes was not touched. There is a ticket to address that in NODE-3769.

What is changing?

This adds a new check for for if a transaction command can be retried, isRetryableEndTransactionError, which bases this solely on if the error contains a "RetryableWriteError" and does not look at the error code.

Is there new documentation needed for these changes?

No

What is the motivation for this change?

NODE-3711

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: <type>(NODE-xxxx)<!>: <description>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@durran durran changed the title fix(NODE-3711): retry txn end on retryable write fix(NODE-3711): retry txn end on retryable write (3.7) Nov 18, 2021
@durran durran changed the title fix(NODE-3711): retry txn end on retryable write (3.7) fix(NODE-3711): retry txn end on retryable write Nov 18, 2021
@dariakp dariakp added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Dec 1, 2021
@dariakp dariakp added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Dec 1, 2021
@dariakp dariakp merged commit 1595140 into 3.7 Dec 1, 2021
@dariakp dariakp deleted the NODE-3711-3.7 branch December 1, 2021 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants