[CSHARP-1160] Either enforce the distinction between Direct and Standalone connection modes or remove Standalone from the enum Created: 08/Jan/15  Updated: 02/Apr/15  Resolved: 15/Jan/15

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: None
Fix Version/s: 2.0

Type: Task 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

Backwards Compatibility: Minor Change

 Description   

Our enum for connection mode currently has two similar values:

1. Direct
2. Standalone

The idea was that a Standalone connection would only succeed when the server was in fact a standalone, whereas a Direct connection would succeed no matter what the actual type of the server was.

This would prevent accidental connections to secondaries or other non-primary servers.

This distinction is not currently fully implemented. We should either completely implement the distinction or remove Standalone from the connection mode enum.

If we decide to keep Standalone, a related question is what the default should be when the connection string only has a single server. Should it be Direct or Standalone?

The argument for Standalone is that this is almost always what the application wants. Directly connecting to a secondary (or arbiter or whatever) is, or should be, a very unusual case.

The argument for Direct would be that it would be more backward compatible.



 Comments   
Comment by Githook User [ 12/Feb/15 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1160: Treat Automatic connection mode like Direct for connections to a single host to allow connecting to a one member replica set without having to specify a connection mode on the connection string. If you want the driver to verify that your are connected to a standalone you can specify connect=standalone on the connection string.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/741237076c3dfee17c5429388ae3a8b379c03e11

Comment by Githook User [ 15/Jan/15 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1160: Enforce the distinction between Standalone and Direct.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/4efda752fdea47acbfdbc58ba88dbd7cfd8e63ef

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