[CSHARP-2245] Driver version 2.5.0 is failing to connect to a hidden replica set member. Created: 19/Apr/18  Updated: 19/Apr/18  Resolved: 19/Apr/18

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 2.5
Fix Version/s: 2.5.1

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

Issue Links:
Duplicate
duplicates CSHARP-2226 Unable to send replSetInitiate to uni... Closed
Related

 Description   

MongoDB C# driver version 2.5.0 failed to connect to a hidden replica set member with the following code:

var client = new MongoClient( new MongoClientSettings { 
                                                ConnectionMode = ConnectionMode.Direct, 
                                                Server = new MongoServerAddress("x.x.x.x", 27017), 
                                         });
var database = client.GetDatabase("db");            
var collection = database.GetCollection<BsonDocument>("collection");
var document = collection.Find(new BsonDocument()).FirstOrDefault();

The same code works for version 2.4.x (Tested on 2.4.4 and 2.4.2).



 Comments   
Comment by Robert Stam [ 19/Apr/18 ]

Thank you for confirming the fix.

Comment by Wan Bachtiar [ 19/Apr/18 ]

Confirmed, 2.5.1 fixed the issue. Thanks you rstam

Comment by Robert Stam [ 19/Apr/18 ]

I believe that while the scenario is slightly different it shares the same underlying cause as CSHARP-2226, which was fixed in the recently released 2.5.1 version.

Comment by Wan Bachtiar [ 19/Apr/18 ]

Briefly, it looks like version 2.5.0 introduced a change for session to detect IsDataBearingServer ServerDescription.cs#L205-227
Perhaps it needs to include ReplicaSetOther ?

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