node-mongodb-native icon indicating copy to clipboard operation
node-mongodb-native copied to clipboard

fix(NODE-3541): allow unacknowledged write with hint

Open LinusU opened this issue 3 years ago • 2 comments

Description

This is a replacement to #3409, from the knowledge I got there I could implement this properly instead of just improving the error message!

Now it actually fixes the entire ticket 🎉

What is changing?

The driver now allows unacknowledged writes when a hint is present in the following scenarios:

  • In update calls when the server is 4.2 or newer
  • In delete calls when the server is 4.4 or newer
Is there new documentation needed for these changes?

Not as far as I know, because I couldn't find any documentation on this limit in the first place.

What is the motivation for this change?

This allows us to submit a hint to an unacknowledged write. See more background in NODE-3541.

Double check the following

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

I also need to update the tests here, but since this is my first contribution here I would love some guidance.

What I think we need to do is to update the test/spec/crud/unified/unacknowledged-*-hint-clientError.yml files and make them only test for the error on specific server versions, but expect success on others. If anyone could point me in the right direction here I would be grateful. Should we also rename the files to remove "clientError" from the name? Actually, the ticket mentions syncing unified CRUD tests, that might be what we should instead?

ping @baileympearson, thank you for reviewing my first PR, and giving me info to continue this!

LinusU avatar Sep 15 '22 15:09 LinusU

Hey @LinusU - thanks for this contribution. There are still some open questions about this ticket and at this time, it's not ready to be implemented. Our team will need to discuss the ticket in refinement to iron out some of the details.

We don't have the bandwidth to pick this up at the moment but we will put the ticket in our triage queue to revisit it when we get the chance and when we do implement it, we'll make sure you get credit for your contribution as well.

I think we can move forward with https://github.com/mongodb/node-mongodb-native/pull/3409 in the meantime though!

baileympearson avatar Sep 16 '22 14:09 baileympearson

I understand, let me know if there is anything you want me to do here 👍

LinusU avatar Sep 29 '22 18:09 LinusU