[CXX-646] C++ driver does not connect to replica sets when all members specified Created: 04/Aug/15 Updated: 19/Oct/15 Resolved: 16/Oct/15 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | API |
| Affects Version/s: | legacy-1.0.3 |
| Fix Version/s: | legacy-1.0.6 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Steve Ahlgren | Assignee: | Adam Midvidy |
| Resolution: | Done | Votes: | 0 |
| Labels: | legacy-cxx | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Description |
|
We're upgrading from 2.x to 3.0.4 and are having difficulty connecting to a fresh 3.0.4 replica set via the C++ 1.0.3 driver. If the connection string contains just a single member of the set, connection/auth works perfectly, but if all replica set members are specified, auth fails. Using either mongo::DBClientReplicaSet or mongo::ConnectionString::connect results in the same failure behavior. When multiple members of a set are specified, the driver does not detect that it's connecting to a Mongo 3 instance, and will attempt to use MONGO-CR instead of SCRAM-SHA1. Tracing through the client code, the client is setting its minimum and maximum wireline versions to (0,0) instead of (0,3) when connecting to the 3.0.4 replica set, which then causes it to default to MONGO-CR as its authentication mechanism. If we add code to detect the wireline version after making a connection (as is done by the driver when connecting to a single machine), the authentication type is set correctly and authentication succeeds. Are we doing something wrong or is this a defect in the driver? FWIW, connecting to the same replica sets with the Python driver works as expected when all members are listed... A test executable is attached. To build, update the property sheets with the correct locations for boost, mongo, openssl, and gmock. Enable one of the two test methods DISABLED_TestConnectionReplicaSetAuth or DISABLED_TestConnectionReplicaSetConnectionStringAuth to reproduce the issue. |
| Comments |
| Comment by Githook User [ 16/Oct/15 ] |
|
Author: {u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}Message: |
| Comment by Githook User [ 16/Oct/15 ] |
|
Author: {u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}Message: |
| Comment by Githook User [ 16/Oct/15 ] |
|
Author: {u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}Message: |
| Comment by Githook User [ 16/Oct/15 ] |
|
Author: {u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}Message: |
| Comment by Adam Midvidy [ 06/Oct/15 ] |
|
New pull request: https://github.com/mongodb/mongo-cxx-driver/pull/319 This makes the necessary improvements to our test infrastructure so we can prevent future regressions like this from happening again. |
| Comment by Adam Midvidy [ 05/Aug/15 ] |
| Comment by Adam Midvidy [ 04/Aug/15 ] |
|
Thanks for the detailed report sga. From your description, this sounds like a bug in the driver. I will work on reproducing this issue and then I will follow up on this ticket. |