[JAVA-284] Support replica set name in MongoClientURI and MongoClientOptions Created: 25/Feb/11  Updated: 30/Jan/15  Resolved: 27/Feb/14

Status: Closed
Project: Java Driver
Component/s: Configuration
Affects Version/s: 2.5
Fix Version/s: 2.12.0, 3.0.0

Type: Improvement Priority: Major - P3
Reporter: Brendan W. McAdams Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: rc1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVA-244 MongoURI for Java Driver should suppo... Closed
Backwards Compatibility: Fully Compatible

 Description   

As in other drivers, the name of the query parameter in the URI is replicaSet. In MongoClientOptions, the slightly more descriptive property name of requiredReplicaSetName will be used. The presence of the replica set name in either place will have two effects:

  1. it will force the driver into replica-set mode, which means that even if there is only one member provided in the seed list, the driver will treat this as a replica set connection and discover all members (even so, users are still highly encouraged to provide at least a three member seed list).
  2. the driver will drop seed list members that are either not replica set members or else members of a replica set with a different name. This will be logged as SEVERE.


 Comments   
Comment by Githook User [ 30/Jan/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-284: Adding requiredReplicaSetName property in MongoOptions
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/9d120bf66eedeab31b51eff5a83f6ef8b876dc39

Comment by Githook User [ 29/Apr/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-284: Adding requiredReplicaSetName property in MongoOptions
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/9d120bf66eedeab31b51eff5a83f6ef8b876dc39

Comment by Jeffrey Yemin [ 27/Feb/14 ]

Fixed in master for 2.12.0

Comment by Githook User [ 27/Feb/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-284: Support replica set name in MongoClientURI and MongoClientOptions
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/9bb0f73d3f6702029657d3901c95a155dc79cab1

Comment by auto [ 28/Aug/13 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-284: Support replicaSet option in URI and requiredReplicaSetName is MongoClientOptions
Branch: 3.0.x-refactor-operations
https://github.com/mongodb/mongo-java-driver/commit/dfc5284153bfb537de0b678ed9ddbc5d606a57c4

Comment by auto [ 23/Aug/13 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-284: Refactoring ClusterFactory and Cluster implementations to take a ClusterSettings instead of just the list of server addresses.
This allows passing of additional required settings, like cluster mode and required replica set name.
Ensure that the replica set that the cluster connects to has a name than matches the specified required replica set name.
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/d598f4219046c15a1a5df708d0a278030aaeccea

Comment by auto [ 23/Aug/13 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-284: Support replicaSet option in URI and requiredReplicaSetName is MongoClientOptions
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/dfc5284153bfb537de0b678ed9ddbc5d606a57c4

Comment by ian wood [ 20/Feb/13 ]

fyi: in 2.10.1 MongoClientURI(String uri) currently reports "Unknown or Unsupported Option 'replicaset'" if that option is present.

Comment by T. Dampier [ 21/Apr/12 ]

Partial fix offered here: https://github.com/mongodb/mongo-java-driver/pull/72

As of this writing, that pull request doesn't verify the name once connected, but does correctly parse the option and force a replica set (not single-server) connection.

Also: is the "connect" option still part of the URI spec? I don't see it mentioned in http://www.mongodb.org/display/DOCS/Connections

Is there a more definitive document?

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