[CSHARP-892] Rerouting commands to the Primary does not always work when ConnectionMode is Automatic Created: 17/Jan/14  Updated: 02/Apr/15  Resolved: 17/Jan/14

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.8.3
Fix Version/s: 1.9

Type: Bug Priority: Major - P3
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When running commands the ReadPreference is overridden and the command is sent to the Primary if the command is not white listed as being allowed to be run on a Secondary. This overriding should only be done when connected to a ReplicaSet.

However, when using Automatic ConnectionMode a DiscoveringMongoServerProxy is used, and the actual type of the cluster is not known until after Connect has been called.

The code that reroutes commands to the primary should ensure that the proxy type is not Unknown before deciding whether to reroute the command or not.



 Comments   
Comment by Githook User [ 17/Jan/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@10gen.com'}

Message: CSHARP-892: Fix command rerouting when ConnectionMode is Automatic.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/dc24e9ed498a5eecb56068bda425824deef40170

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