Skip to content

Conversation

egiurleo
Copy link
Contributor

From the server selection spec:

Therefore, when sending queries to a mongos, the following rules apply:

  • For mode 'primary', drivers MUST NOT set the slaveOK wire protocol flag and MUST NOT use $readPreference
  • For mode 'secondary', drivers MUST set the slaveOK wire protocol flag and MUST also use $readPreference
  • For mode 'primaryPreferred', drivers MUST set the slaveOK wire protocol flag and MUST also use $readPreference
  • For mode 'secondaryPreferred', drivers MUST set the slaveOK wire protocol flag. If the read preference contains a non-empty tag_sets parameter, maxStalenessSeconds is a positive integer, or the hedge parameter is non-empty, drivers MUST use $readPreference; otherwise, drivers MUST NOT use $readPreference
  • For mode 'nearest', drivers MUST set the slaveOK wire protocol flag and MUST also use $readPreference

Our read preference op message tests did not test for this behavior, so I have updated the tests and modified the existing code. The actual work for RUBY-2184 will be completed on top of this work.

@egiurleo egiurleo changed the title RUBY-2184: make $readPreference behave as specified RUBY-2184: [wip ]make $readPreference behave as specified May 27, 2020
@egiurleo egiurleo changed the title RUBY-2184: [wip ]make $readPreference behave as specified RUBY-2184: [wip] make $readPreference behave as specified May 27, 2020
@egiurleo egiurleo changed the title RUBY-2184: [wip] make $readPreference behave as specified RUBY-2184: Make $readPreference behave as specified May 29, 2020
@egiurleo egiurleo requested a review from p-mongo May 29, 2020 20:34
@egiurleo egiurleo merged commit f4c0acb into mongodb:master May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants