-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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-3083): support aggregate writes on secondaries #3022
Conversation
bb6a774
to
8e64d3b
Compare
6f7ddb5
to
41ea187
Compare
892dcf1
to
900cc19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question to make sure I understand the implementation (I'll take a second pass at the newly added tests once I better understand the context, but I'll move it to team review)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small requests regarding the tests; I think we're all happy with the actual code approach, and thank you so much for adding the new unit tests!
Co-authored-by: Daria Pardue <[email protected]>
Co-authored-by: Daria Pardue <[email protected]>
Description
Allows $merge and $out aggregate operations to execute on secondaries. The logic here is:
The spec specifically avoids multi-version clusters, so we can handle this at server selection by implementing our own server selection function for this case that does not need to scan twice.
Includes NODE-3684 to skip $out/$merge tests on serverless
What is changing?
Operations can be flagged with
trySecondaryWrite
to use the new server selector function. This function looks at the read preference and common wire version of the topology to potentially change the read preference used to select the server.Is there new documentation needed for these changes?
Potentially if we want to let users know about this new feature in the node docs.
What is the motivation for this change?
DRIVERS-823
Double check the following
npm run check:lint
script<type>(NODE-xxxx)<!>: <description>