[GODRIVER-1782] Aggregation with $out not always sent to primary Created: 06/Nov/20  Updated: 28/Oct/23  Resolved: 24/Nov/20

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

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

Issue Links:
Depends
Related

 Description   

Based on the check here, the read preference should not be set for an aggregation that contains a $out (or $merge). However, when the pipeline is checked for a $out stage here, it does LookupErr("$out") on an array document that looks like this:

{"0": {"$out": {"db": "test_db","coll": "test_dcoll"}}}

So no top-level $out is found, and the readPref is being set, resulting in a potential error on $out.



 Comments   
Comment by Githook User [ 24/Nov/20 ]

Author:

{'name': 'Isabella Siu', 'email': 'isabella.siu@mongodb.com', 'username': 'iwysiu'}

Message: GODRIVER-1782 correctly mark aggregation pipeline with $out (#537)
Branch: release/1.4
https://github.com/mongodb/mongo-go-driver/commit/60824655b5a6fa3690f8066fe9a5c424029a0d29

Comment by Githook User [ 24/Nov/20 ]

Author:

{'name': 'Isabella Siu', 'email': 'isabella.siu@mongodb.com', 'username': 'iwysiu'}

Message: GODRIVER-1782 correctly mark aggregation pipeline with $out (#537)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/c4dde16ec1400fe53d3100d8c370bbd7e14e939f

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