[GODRIVER-2231] Check if readpref was overwritten in operation.createReadPref Created: 15/Nov/21  Updated: 30/Mar/22

Status: Backlog
Project: Go Driver
Component/s: Wire Protocol
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Benji Rewis (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to GODRIVER-2220 Ignore read preference for $out/$merg... Closed

 Description   

Because of recent changes in GODRIVER-2220, if a user runs an aggregate with an output stage ($out or $merge), we will overwrite their supplied read preference with "primary" if there are any candidate servers that are < 5.0 (wire version 13).

operation.createReadPref should check if we overwrote the read preference, and if so, return no $readPreference to attach to the command. At the moment, we only check if the underlying operation was an output-aggregate and the selected server is < 5.0.

In a P5 + S4 + S5 situation where the user provided a "secondary" read preference, a $readPreference of "secondary" would be sent to a primary. While this will not cause an error, it is incorrect ("secondary" was not the effective read pref) and may mislead users of command monitoring.


Generated at Thu Feb 08 08:38:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.