[DRIVERS-2632] Test readPreference for runCommand on Direct Connection to Secondary Created: 19/May/23 Updated: 23/Jun/23 |
|
| Status: | Backlog |
| Project: | Drivers |
| Component/s: | CRUD |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Preston Vasquez | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Driver Changes: | Needed | ||||
| Description |
SummaryExtend the runCommand unified spec tests (or prose tests) to check the case where a user makes a direct connection to a secondary node in a replica set. In this case, we would expect a read preference to exist but as a primaryPreferred. MotivationThe Go Driver explicitly defaults the read preference for non-standalone and non-single nodes to "Primary". This behavior is probably not necessary, but we should still ensure that, in the case where a user creates a direct connection to a secondary node, the default behavior is that read preference is explicitly set to "PrimaryPreferred" Who is the affected end user?Go Driver How does this affect the end user?NA How likely is it that this problem or use case will occur?Main path If the problem does occur, what are the consequences and how severe are they?NA Is this issue urgent?No Is this ticket required by a downstream team?No Is this ticket only for tests?Yes Acceptance CriteriaA new unified spec test that tests the case mentioned in the Summary section. |
| Comments |
| Comment by Jeremy Mikola [ 23/Jun/23 ] |
|
preston.vasquez@mongodb.com: Moving this to the backlog but feel free to pick this up at any point and contribute a prose test. I don't think it's worth complicating the unified test format's runOnRequirement structure to detect direct connections to replica set members, if only because drivers don't typically run their test suites with such configurations. A prose test where the driver could modify an existing replica set URI as needed seems more appropriate (such as connecting, pulling out a secondary's host from the topology, and reconnecting with that). I realize this was opened against the CRUD component, but I don't think a prose test belongs in the CRUD spec. The RunCommand spec seems more appropriate. esha.bhargava@mongodb.com: I see there's no DRIVERS component for the RunCommand spec. Should there be? If so, can you create one and move this ticket over? |