Skip to content

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Nov 30, 2021

Description

Prior to these changes, when ReadPreference.fromOptions was passed a string for the read preference, hedge configuration and maxStalenessSeconds were not set on the ReadPreference object. This PR passes hedge configuration and maxStalenessSeconds configuration through to the read preference object when it is created using ReadPreference.fromOptions with a string as the read preference.

Additionally, this PR moves unit tests for the ReadPreference class into the unit test suite from the functional test suite.

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

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.

Nice! this looks close to ready

@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Nov 30, 2021
@baileympearson baileympearson changed the title fix(NODE-3705): propagate hedge settings through ReadPreference.fromOptions fix(NODE-3705): fix ReadPreference.fromOptions factory method when read preference is a string Nov 30, 2021
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 some more small improvements, but I'll open this up to the team now

@nbbeeken nbbeeken requested review from dariakp and durran November 30, 2021 19:41
@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 Nov 30, 2021
Signed-off-by: Bailey Pearson <bailey.pearson@mongodb.com>
@nbbeeken nbbeeken changed the title fix(NODE-3705): fix ReadPreference.fromOptions factory method when read preference is a string fix(NODE-3705): ReadPreference.fromOptions omitting hedge and maxStalenessSeconds when readPreference is a string Dec 1, 2021
@nbbeeken nbbeeken merged commit b9fbac5 into main Dec 1, 2021
@nbbeeken nbbeeken deleted the NODE-3705/enable-hedge-options-when-readPreference-is-string branch December 1, 2021 21:12
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