[GODRIVER-1522] Read preference should not be sent to mongos for aggregations with output stages Created: 04/Mar/20  Updated: 28/Oct/23  Resolved: 10/Mar/20

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: 1.3.0
Fix Version/s: 1.3.2

Type: Bug Priority: Major - P3
Reporter: Divjot Arora (Inactive) Assignee: Divjot Arora (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Our aggregation code unconditionally passes down the collection's read preference to the operations layer. This is fine for replica sets because we use the write selector for aggregations with output stages ($out/$merge) but not for sharded clusters because the lower level will pass the read preference to the mongos.

I have verified that the a $out with read preference secondary does not work as expected against a sharded cluster and the output collection is not created.



 Comments   
Comment by Githook User [ 10/Mar/20 ]

Author:

{'name': 'Divjot Arora', 'username': 'divjotarora', 'email': 'divjot.arora@10gen.com'}

Message: GODRIVER-1522 Ignore read preference for aggregations with output stages (#327)
Branch: release/1.3
https://github.com/mongodb/mongo-go-driver/commit/cd959e15b2efed2098faa60f4be9c6a472ce3942

Comment by Githook User [ 10/Mar/20 ]

Author:

{'name': 'Divjot Arora', 'username': 'divjotarora', 'email': 'divjot.arora@10gen.com'}

Message: GODRIVER-1522 Ignore read preference for aggregations with output stages (#327)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/4f5fc1942fcfbb4d32d445cec0974a4a4a11111f

Comment by Divjot Arora (Inactive) [ 10/Mar/20 ]

https://github.com/mongodb/mongo-go-driver/pull/327

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