[GODRIVER-403] command.Encode doesn't set slaveOk flag Created: 02/May/18  Updated: 28/Oct/23  Resolved: 23/May/18

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

Type: Bug Priority: Major - P3
Reporter: Sebastian Bauer Assignee: Kristofer Brandow (Inactive)
Resolution: Fixed Votes: 0
Labels: Stitch, charts
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
is caused by GODRIVER-419 Set the Kind when returning a topolog... Closed

 Description   

I create a new client with ConnString, set Connect: connstring.SingleConnect and ReadPreference: "secondaryPreferred". The direct connection is working but all queries get the error "(NotMasterNoSlaveOk) not master and slaveOk=false".

command.Encode should set the slaveOk flag. What's missing to propagate the SingleConnect and secondaryPreferred preference to this point?



 Comments   
Comment by Githook User [ 23/May/18 ]

Author:

{'username': 'skriptble', 'name': 'Kris Brandow', 'email': 'kris@mongodb.com'}

Message: Enable reading from secondaries

GODRIVER-403
GODRIVER-419

Change-Id: Ib4edb546db7491300dccdf2a435420c323a4b09b
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/3e7fde5d9e1defd2ba03a27aa8b6cd257660253b

Comment by Kristofer Brandow (Inactive) [ 18/May/18 ]

Code Review: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/411752.

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