[SERVER-42407] sharding/read_pref_cmd.js should assume less about secondaryPreferred + tag_sets Created: 24/Jul/19  Updated: 29/Oct/23  Resolved: 08/Oct/19

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Bug Priority: Major - P3
Reporter: Mira Carey Assignee: Rahul Sundararaman (Inactive)
Resolution: Fixed Votes: 0
Labels: servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2019-10-07, Service Arch 2019-10-21
Participants:
Linked BF Score: 8

 Description   

From the server selection spec:

primaryPreferred and secondaryPreferred
'primaryPreferred' is equivalent to selecting a server with read preference mode 'primary' (without tag_sets or maxStalenessSeconds), or, if that fails, falling back to selecting with read preference mode 'secondary' (with tag_sets and maxStalenessSeconds, if provided).

'secondaryPreferred' is the inverse: selecting with mode 'secondary' (with tag_sets and maxStalenessSeconds) and falling back to selecting with mode 'primary' (without tag_sets or maxStalenessSeconds).

Depending on the implementation, this may result in cleaner code.

sharding/read_pref_cmd.js assumes that secondaryPreferred + tag_sets won't hit the primary if it doesn't have the designated tag. But that isn't how it's coded, or how server selection is intended to work.

We should remove those test cases



 Comments   
Comment by Githook User [ 08/Oct/19 ]

Author:

{'name': 'Rahul Sundararaman', 'email': 'rahul.sundararaman@mongodb.com'}

Message: SERVER-42407 Sharding/read_pref_cmd.js should assume less about secondaryPreferred + tag_sets
Branch: master
https://github.com/mongodb/mongo/commit/946189b0389432037c248835c8f2924d7a0c8e5d

Generated at Thu Feb 08 05:00:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.