-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: Aggregation
Use Case
I have several aggregations using $out or $merge ("write stages") where I want to read from a secondary using readPreference: 'secondary'.
The provided readPreference is not used if the operation has a write stage in execeute_operation because topology.commonWireVersion is 0, resulting in the wrong custom server selector being returned in server_selection where it falls back to using ReadPreference.primary.
Root cause is probably commonWireVersion being initialised with 0 instead of null in topology_description_ctor and then not being updated in topology_description_update
User Experience
- Desired outcome: The provided read preference is used when operation has write stage.
- Impact: All customers using aggregations with write stages and read preference 'secondary'. Falls back to primary read preference.
Dependencies
- n/a
Risks/Unknowns
- n/a
Acceptance Criteria
Implementation Requirements
- functional reqs, potential snafus to avoid, performance targets, etc
Testing Requirements
- unit test, spec test sync, etc
Documentation Requirements
- DOCSP ticket, API docs, etc
Follow Up Requirements
- additional tickets to file, required releases, etc
- if node behavior differs/will differ from other drivers, confirm with dbx devs what standard to aim for and what plan, if any, exists to reconcile the diverging behavior moving forward