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

feat(NODE-4756)!: ok 1 with write concern failure event changes #3525

Merged
merged 7 commits into from
Jan 19, 2023

Conversation

durran
Copy link
Member

@durran durran commented Jan 17, 2023

Description

For commands with write concern errors but an { ok: 1 } in the command reply, the driver now emits a command succeeded event.

What is changing?

  • Command monitoring now emits a CommandSucceededEvent when a reply has { ok: 1 } with write concern errors.
  • Added a second test in the retryable writes prose tests that confirms the above behaviour.
  • Added a unified test for DRIVERS-2468 since that ticket was still in the backlog. This test also confirms the behaviour.

Specs PR: mongodb/specifications#1367

Is there new documentation needed for these changes?

None

What is the motivation for this change?

NODE-4756/DRIVERS-2468

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

@durran durran force-pushed the NODE-4756 branch 2 times, most recently from 040ef39 to c523c1d Compare January 17, 2023 13:19
@durran durran changed the title feat(NODE-4756): ok 1 with write concern failure event changes feat(NODE-4756)!: ok 1 with write concern failure event changes Jan 17, 2023
@durran
Copy link
Member Author

durran commented Jan 17, 2023

Lint failure unrelated to this PR but addressed in #3524

@durran durran force-pushed the NODE-4756 branch 3 times, most recently from a52b422 to de23ac1 Compare January 17, 2023 14:13
@@ -500,7 +500,8 @@ function makeOperationHandler(
): Callback {
const session = options?.session;
return function handleOperationResult(error, result) {
if (result != null) {
// We should not swallow an error if it is present.
if (error == null && result != null) {
Copy link
Member Author

@durran durran Jan 17, 2023

Choose a reason for hiding this comment

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

If we are not monitoring commands the operation description's callback doesn't get wrapped and thus both an error and result are present here.

@durran durran marked this pull request as ready for review January 17, 2023 14:40
@dariakp dariakp added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Jan 17, 2023
@durran durran requested a review from nbbeeken January 18, 2023 19:08
Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

LGTM

@nbbeeken nbbeeken added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Jan 19, 2023
Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

just got a lint error, I thought it was the one that was on main for a bit, but that's been fixed

@durran
Copy link
Member Author

durran commented Jan 19, 2023

just got a lint error, I thought it was the one that was on main for a bit, but that's been fixed

Ah that pesky import.

nbbeeken
nbbeeken previously approved these changes Jan 19, 2023
src/cmap/connection.ts Outdated Show resolved Hide resolved
@nbbeeken
Copy link
Contributor

note: red CI is unrelated to changes here, I've filed a ticket about the new failures and we know about the FLE CI script issue

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