[CXX-97] C++ driver should allow GridFS slaveOk querying Created: 11/Apr/12  Updated: 08/Jul/14  Resolved: 02/Jul/14

Status: Closed
Project: C++ Driver
Component/s: API
Affects Version/s: None
Fix Version/s: legacy-0.11.0

Type: New Feature Priority: Major - P3
Reporter: Aristarkh Zagorodnikov Assignee: Tyler Brock
Resolution: Done Votes: 1
Labels: cxxmove, gridfs, legacy-cxx, neweng, replicaset, slaveOk
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Currently, C++ driver GridFS API does not support slaveOk.
Adding "slaveOk" boolean parameter with a "false" default value to GridFS::findFile and GridFS::list would be nice.
Then, it should be cached inside the resulting GridFile and used for subsequent file queries (GridFile::getChunk, GridFile::write).



 Comments   
Comment by Tyler Brock [ 02/Jul/14 ]

merged

Comment by Githook User [ 02/Jul/14 ]

Author:

{u'username': u'TylerBrock', u'name': u'Tyler Brock', u'email': u'tyler.brock@gmail.com'}

Message: CXX-97 Enable read preference for gridfs querying
Branch: legacy
https://github.com/mongodb/mongo-cxx-driver/commit/069d9fefcca2b384be46d8ef8275f77cd91946b0

Comment by Tyler Brock [ 02/Jul/14 ]

https://github.com/mongodb/mongo-cxx-driver/pull/111

Comment by Andrew Morrow (Inactive) [ 02/Jul/14 ]

Hi onyxmaster -

RE async: yes, we are thinking about it, but we do not have concrete plans at this point.

Thanks,
Andrew

Comment by Aristarkh Zagorodnikov [ 02/Jul/14 ]

Thanks for the response.
My proposed patch (https://bitbucket.org/onyxmaster/mod_gridfs/src/f7d5e545e0cf0f84afe9597827a95e143e31e695/patches/gridfs?at=v0.3) handles ReadPreference also, although I understand it's a bit dated.

I look forward to new C++ driver that would support all the bells and whistles for GridFS queries.

As a side note, I wonder if there is an idea to have an async (epoll, etc.)-based driver. Currently nginx-gridfs module works too slow only because there's no async support. While rolling one's own "driver" (it only needs to support a subset of the protocol, only predetermined queries) is perfectly feasible for such specific case, I'm unsure about what plans do you have on this matter.

Comment by Tyler Brock [ 30/Jun/14 ]

I know it has been a while onyxmaster, but we are looking at this now and want to keep you updated. Thank you for your patience.

We definitely need to allow for secondary reads for GridFS but doesn't make sense for GridFile::write to do so as secondaries do not take writes.

Since this pull request and change was proposed we have forked the C++ driver from the server and are working on adding improvements such as this one to the driver. I'm going to try to add what feels like the same functionality but with ReadPreference (as that is how we do things now).

Comment by Aristarkh Zagorodnikov [ 20/Apr/12 ]

I understand that, so I worked around by adding a source patch in https://bitbucket.org/onyxmaster/mod_gridfs =)

Comment by Eliot Horowitz (Inactive) [ 20/Apr/12 ]

We are definitely planning on doing this - just have a lot of things to get done.

Comment by Aristarkh Zagorodnikov [ 19/Apr/12 ]

On the other hand, this still might be useful for other applications if you intend to release C++ driver separately.

Comment by Aristarkh Zagorodnikov [ 19/Apr/12 ]

Well, it looks like I have to roll my own driver for mod_gridfs, feel free to close this issue.

Comment by Aristarkh Zagorodnikov [ 15/Apr/12 ]

Improved pull request a little bit to preserve parameter order.

Comment by Aristarkh Zagorodnikov [ 12/Apr/12 ]

I've added a pull request that implements this feature: https://github.com/mongodb/mongo/pull/210.

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