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-4863): do not use RetryableWriteError for non-server errors #3914

Merged

Conversation

alenakhineika
Copy link
Contributor

@alenakhineika alenakhineika commented Nov 8, 2023

Description

Use the MongoErrorLabel.PoolRequstedRetry label instead of misused MongoErrorLabel.RetryableWriteError for non-server errors according to spec.

What is changing?

  • The PoolClearedError constructor adds the new MongoErrorLabel.PoolRequstedRetry label instead of misused MongoErrorLabel.RetryableWriteError.
  • The isRetryableWriteError function checks if PoolRequstedRetry or RetryableWriteError is set to determine if retryOperation is required.
Is there new documentation needed for these changes?

None

What is the motivation for this change?

NODE-4863

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
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@alenakhineika alenakhineika marked this pull request as ready for review November 8, 2023 18:35
@durran durran changed the title fix(NODE-4863): do not use RetryableWriteError for non-server errors feat(NODE-4863): do not use RetryableWriteError for non-server errors Nov 8, 2023
@durran durran changed the title feat(NODE-4863): do not use RetryableWriteError for non-server errors fix(NODE-4863): do not use RetryableWriteError for non-server errors Nov 8, 2023
@durran durran self-assigned this Nov 8, 2023
@durran durran added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Nov 8, 2023
Copy link
Member

@durran durran left a comment

Choose a reason for hiding this comment

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

Just notes for other reviewers, the testing requirements made it seem to me like the prose test #2 should change somehow, but checking the spec this test matches so no change actually needed there.

The second testing requirement I'm not sure where that came from but I think the additional unit test added here suffices.

@durran durran added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Nov 8, 2023
@durran durran merged commit 08c9fb4 into main Nov 9, 2023
26 checks passed
@durran durran deleted the NODE-4863-no-retryable-write-label-for-non-server-errors branch November 9, 2023 17:06
aditi-khare-mongoDB pushed a commit that referenced this pull request Nov 17, 2023
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.

4 participants