...
If a mongod server has been disconnected from other servers, applications using the C++ driver to mongod server could experience as much as 55 seconds of delay every 10 seconds of connectivity. Issue details discussed on forum https://groups.google.com/forum/#!topic/mongodb-user/3roJxyGO2Wc
thomasr commented on Mon, 7 Jul 2014 19:43:40 +0000: Hi Douglas, I believe Randolph has provided the answer to this issue in his last reply, and based on your last comment, I'll mark this issue resolved now. Kind Regards, Thomas dhubler commented on Tue, 10 Jun 2014 23:09:30 +0000: thanks for getting back to me. unfortunately I wasn't able to try this as I am no longer working on that project that use mongo. I'll forward to appropriate people though. On Tue, Jun 10, 2014 at 6:18 PM, Ramon Fernandez (JIRA) ramon.fernandez commented on Tue, 10 Jun 2014 22:13:02 +0000: Hi dhubler, have you had a chance to try out renctan's suggestion above of calling the done method? Can you please let us know if this is still an issue for you? Thanks, Ramón. renctan commented on Tue, 22 Apr 2014 15:01:42 +0000: I apologize for the late response. I was referring to your code - which creates a fresh new connection in every iteration of the loop. If you call done before you delete the sc pointer, then the connection will be reused on the next iteration. The C++ driver current doesn't support setting the read preference on the connection level. dhubler commented on Tue, 29 Oct 2013 16:31:57 +0000: Interesting, so you're saying for a workaround, instead of specifying a read preference for each query, set the read preference on the connection object. I'll have to try that. Just to be clear, you're saying this is still an issue, you're just providing a possible workaround. BTW: You have sample code for on how to use read preference tags AND nearest on connection in C++? I couldn't figure it out and it took a lot reading the code just to discover how to do it on query. renctan commented on Tue, 29 Oct 2013 15:38:09 +0000: Hi, As long as you reuse the same connection object over and over, you should be able to minimize the lockout from ReplicaSetMonitor::check because the DBClientReplicaSet instance will keep on using the same secondary node as much as possible without talking to the ReplicaSetMonitor as long as you don't change the read preference settings or the secondary doesn't error out. dhubler commented on Sat, 19 Oct 2013 02:39:06 +0000: Attaching java driver that doesn't exhibit same behavior dhubler commented on Fri, 18 Oct 2013 21:49:03 +0000: Instructions Adjust test too for your env. and compile as executable setup mongod replica set with 3 or more nodes configure read preference to allow to read from secondary separate single mongod server from all other nodes Expected node should be in read only mode Actual startup takes several minutes on system w/11 mongod servers every 10 seconds queries return data, they hang for 55 seconds while c++ driver retests all connections
install and setup 3 or more mongod servers in a replicaset setup read preference tags so queries can be controlled to specific servers take one server and disconnect it from all others. e.g. myhost.example.org write a tool in c++ that : uses a ScopedDbConnection to connect mongo cluster perform one or more read-only queries that uses read preference tags to select myhost.example.org exits run tool ./dbtest1 myreplset/myhost.mydomain