[JAVA-381] Support redundant mongos connections Created: 14/Jun/11  Updated: 07/Mar/14  Resolved: 20/Jul/12

Status: Closed
Project: Java Driver
Component/s: Connection Management
Affects Version/s: None
Fix Version/s: 2.9.0

Type: New Feature Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Jeffrey Yemin
Resolution: Done Votes: 1
Labels: server-2.2.0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to JAVA-1139 Allow configuration of heartbeat back... Closed
related to SERVER-2499 mongos isMaster should return peers Closed
is related to JAVA-338 list of servers (not in replicaset mode) Closed

 Description   

Add support for a redundant connection mode to mongos instances much like connecting to replicasets work.

Mongo constructor that takes a seed list should detect whether it is a list of mongos instances or a list of replica set members. If the latter, it should work the same as now. If the former, the driver should select the mongos with the lowest ping time and send all traffic to it, failing over if that one becomes unavailable.



 Comments   
Comment by Jeffrey Yemin [ 29/Aug/12 ]

Closing as part of 2.9.0 release process.

Comment by auto [ 21/Aug/12 ]

Author:

{u'date': u'2012-08-20T17:59:39-07:00', u'email': u'jeff.yemin@10gen.com', u'name': u'Jeff Yemin'}

Message: JAVA-381: Partially reverted last change. The synchronization does have to be outside the null check, otherwise it's a race condition and the notification may never be received
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/5dbfb40bb4d5afd2fc7b66e2726da4ea6a09103f

Comment by auto [ 16/Aug/12 ]

Author:

{u'date': u'2012-08-16T07:09:10-07:00', u'email': u'jeff.yemin@10gen.com', u'name': u'Jeff Yemin'}

Message: JAVA-381: Improved the Javadoc
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/53edd86f65a6e413a3e4fb7b8498738551ef13db

Comment by auto [ 14/Aug/12 ]

Author:

{u'date': u'2012-08-13T17:45:29-07:00', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-381: Removed over-synchronized methods. Thanks to Franklin Nwankwo for pointing it out.
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/3fb3f07b5587c74193407b2633296979f40727c9

Comment by auto [ 20/Jul/12 ]

Author:

{u'date': u'2012-07-20T07:18:59-07:00', u'email': u'jeff.yemin@10gen.com', u'name': u'Jeff Yemin'}

Message: JAVA-381: Some cleanup from code review
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/fac59153f5ced9ed7eda92366c6b9f5a43b4022b

Comment by auto [ 20/Jul/12 ]

Author:

{u'date': u'2012-07-18T09:11:07-07:00', u'email': u'jeff.yemin@10gen.com', u'name': u'Jeff Yemin'}

Message: JAVA-381: Added support for detecting a mongos connection
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/9a32cd62be7b22a361e44c62b123b2f0cd541fb0

Comment by auto [ 20/Jul/12 ]

Author:

{u'date': u'2012-07-16T14:48:58-07:00', u'email': u'jeff.yemin@10gen.com', u'name': u'Jeff Yemin'}

Message: JAVA-381: fixed race condition
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/861bea82b90c70ae3f0054ad1e6dcb6a1e57ad46

Comment by auto [ 20/Jul/12 ]

Author:

{u'date': u'2012-07-05T11:09:56-07:00', u'email': u'jeff.yemin@10gen.com', u'name': u'Jeff Yemin'}

Message: JAVA-381: Added MongosStatus class as a sibling to ReplicaSetStatus to handle mongos failover.
Refactored ReplicaSetStatus and MongosStatus to share a common base class ConnectionStatus.
Added DynamicConnectionStatus class to handle dynamic discovery of whether a list of seed nodes represents a bunch of mongos servers or a replicaset.
Is uses ExecutorService to handle multiple threads that communicate with each member of the seed list.
Changed DBTCPConnection to depend on DynamicConnectionStatus insteand of ReplicaSetStatus.
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/d51b3648a8e1bf1a7b7886b7ceb343064c9e2225

Generated at Thu Feb 08 08:52:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.