[CSHARP-315] Support ReadPreference (deprecate SlaveOk) Created: 06/Sep/11  Updated: 20/Mar/14  Resolved: 27/Aug/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.2
Fix Version/s: 1.6

Type: New Feature Priority: Major - P3
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 7
Labels: SERVER_V2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by CSHARP-380 Restrict slaveOk reads by Tag Closed
Related
is related to CSHARP-336 Add support for sending commands to s... Closed

 Description   

Support new ReadPreference options and deprecate SlaveOk.



 Comments   
Comment by auto [ 23/Aug/12 ]

Author:

{u'date': u'2012-08-20T13:36:40-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}

Message: CSHARP-315: add support for reading tags from isMaster result.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/cdd29cbc0441af283122d9682d1cf616abf5447e

Comment by auto [ 14/Jul/12 ]

Author:

{u'date': u'2012-07-13T22:22:34-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-315: Changed WrapQuery in MongoCursorEnumerator to send ReadPreference over the wire when sending query to a mongos.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/f4ec867d893270aa1393d8639c77192bfc6d08b7

Comment by auto [ 13/Jul/12 ]

Author:

{u'date': u'2012-07-13T12:46:58-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-315: added support for ReadPreference to MongoConnectionStringBuilder.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/359f49834934b31362d20faa9cd7cfdf3f95d0b8

Comment by auto [ 12/Jul/12 ]

Author:

{u'date': u'2012-07-11T18:30:00-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-315: Added support for ReadPreference to MongoUrl and MongoUrlBuilder.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/134158b1107edd2381268a7ca77f3010a19a1dac

Comment by auto [ 12/Jul/12 ]

Author:

{u'date': u'2012-07-11T10:50:06-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-315: some changes to how ReadPreference instances are created and initialized.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/c8cc71183ff928f391b81960322d0287d655bd86

Comment by auto [ 12/Jul/12 ]

Author:

{u'date': u'2012-07-11T10:34:49-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-315: more work on ReadPreference. Some optimizations based on keeping connected instances sorted by PingTime.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/256303c310e8f98683f9d710ce52e21dc847ca6a

Comment by auto [ 12/Jul/12 ]

Author:

{u'date': u'2012-07-10T20:19:00-07:00', u'email': u'robert@10gen.com', u'name': u'Robert Stam'}

Message: CSHARP-315: Add support for ReadPreference (more work needed).
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/35cb22fce151b7050d6e3be6356e7eed3ef3e218

Comment by Grégoire Seux [ 29/Mar/12 ]

Is there any place we can have an idea of the draft protocol for this functionnality ?

Comment by Robert Stam [ 29/Dec/11 ]

Work on this ticket has not yet commenced because the driver team as a whole has not yet standardized the functionality required. There is also an internal requirement that the drivers not implement this functionality until the wire protocol has been enhanced to allow passing this same information to mongos so that the same read preferences are supported in a sharded environment as in a non-sharded replica set.

Comment by Grégoire Seux [ 29/Dec/11 ]

Another use of this function would be to allow to read from all instances in a replicaset (master and slaves). For now, documentation states that slaveOk queries are routed to slaves only.
My use case is all masters are on one coadt of the US, all slaves on the other coast, slaveOk is not usable when querying from the wrong side

Is there any news on this ticket ? Can I help ?

Comment by Aristarkh Zagorodnikov [ 02/Nov/11 ]

Also interested in this, we already plan for replica sets to span datacenters and having local reads inside each datacenter instead of going over VPN would be helpful latency-wise.

Comment by Grégoire Seux [ 18/Oct/11 ]

it depends on the core server feature SERVER-3358. There seems to be other requests for this feature (SERVER-3980) but usually there are in the drivers jiras (SERVER-3309 & PERL-128)

Comment by Brennan Cheung [ 17/Oct/11 ]

Sounds like this is dependent on the main database (we're using ruby) but waiting for this feature as well. Currently stuck on master/slave until this is implemented.

Comment by Robert Stam [ 10/Oct/11 ]

Thanks for the feedback. Knowing whether or not users are waiting for a particular feature is helpful in scheduling the order they are implemented in. Perhaps others can comment or vote also.

Comment by Grégoire Seux [ 10/Oct/11 ]

This is really a crucial feature for us, I would be glad to help to make it happen.

EDIT (explain why this feature is really useful) :
this is one of the last step that holds us to have one big mongo cluster instead of several smaller clusters in differents datacenter. This feature would allow us to precise : read from the closest data center.

The real last one is the ability to specify on which shards chunks of a given collection are allowed to be moved.

Generated at Wed Feb 07 21:36:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.