[SERVER-10453] Make DBClientReplicaSet::connect always return true Created: 07/Aug/13  Updated: 11/Jul/16  Resolved: 19/Aug/13

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: 2.5.1
Fix Version/s: 2.5.2

Type: Task Priority: Major - P3
Reporter: Randolph Tan Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-10207 auth_slaveok_routing.js failure on V2... Closed
Participants:

 Description   

History:

Version 1:
Connect used to only check connections to the primary so if there is no primary up, it will fail. This in effect, means that clients who only wants to talk to secondaries will fail even if they are available.

Version 2:
Connect is changed to return true if any of the node is ok based on the information from last refresh (this can be at max 10 sec old). This can be problematic if the node information is not refreshed periodically enough. Note: refresh can be triggered by other means, like when another DBClientReplicaSet tries to do queries in certain conditions.

Proposal:
Connect always returns true. All the operations for DBClientReplicaSet makes the necessary preparations for talking to the desired node lazily so there is currently no advantage of using connect. In fact, the current implementation of connect is purely a read only operation. Furthermore, even if we have a very sophisticated connect method, errors can happen right before the client calls query/insert, so I doesn't buy us very much.



 Comments   
Comment by auto [ 22/Aug/13 ]

Author:

{u'username': u'gregstuder', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: Revert "SERVER-10453 Make DBClientReplicaSet::connect always return true"

This reverts commit 961f3761203d4c1e78f44b898b6bb2cf2b98d00b.

Need to create more tests with slaveok and no primary.
Branch: master
https://github.com/mongodb/mongo/commit/0e5d98084e7c37bdbd1917caf13045af5b0e9575

Comment by auto [ 22/Aug/13 ]

Author:

{u'username': u'gregstuder', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: Revert "SERVER-10453 Make DBClientReplicaSet::connect always return true"

This reverts commit 961f3761203d4c1e78f44b898b6bb2cf2b98d00b.

Need to create more tests with slaveok and no primary.
Branch: mater
https://github.com/mongodb/mongo/commit/0e5d98084e7c37bdbd1917caf13045af5b0e9575

Comment by auto [ 19/Aug/13 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-10453 Make DBClientReplicaSet::connect always return true
Branch: master
https://github.com/mongodb/mongo/commit/961f3761203d4c1e78f44b898b6bb2cf2b98d00b

Generated at Thu Feb 08 03:23:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.