[CDRIVER-837] Add support for the readConcern option Created: 11/Sep/15 Updated: 03/Dec/15 Resolved: 18/Nov/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.3.0-beta0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | Hannes Magnusson |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Epic Link: | MongoDB 3.2 | ||||||||||||||||||||||||||||||||||||
| Description |
| Comments |
| Comment by Githook User [ 18/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 17/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yeah, the new API looks great to me. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Matt Cotter [ 17/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Looks great, thanks! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Hannes Magnusson [ 17/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
More or less identical to mongoc_write_concern_t(), with mongoc_read_concern_new() and mongoc_read_concern_set_level(rc, char *level) and mongoc_read_concern_destroy() and coupe of defines for the default levels: MONGOC_READ_CONCERN_LEVEL_MAJORITY and MONGOC_READ_CONCERN_LEVEL_LOCAL. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Matt Cotter [ 17/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Do you know what mongoc_read_concern_t will look like? Will there be a mongoc_read_concern_new() and mongoc_read_concern_destroy()? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 12/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
In other words I agree with you completely. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 12/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
No, applications should be able to call mongoc_collection_find or mongoc_collection_find_with_opts correctly without knowing the server version. There is a caveat if you actually issue a non-"local" readConcern: Other than that, this API will work equally for OP_QUERY and "find" commands. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jeremy Mikola [ 12/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yesterday, bjori mentioned that this new find API is only intended to create find commands. The older BSON-based API (query document as a bson_t) will need to be used for servers before 3.2, although there will be up-convert logic, which I believe will not support things like readConcern. If I understand correctly, this will require an application or driver to issue version checks before deciding the API to use in a mixed-version cluster. I'd strongly suggest having the new API down-convert where possible and raise errors in the event that a user attempts to use 3.2+ features (e.g. readConcern) but the driver decides it must down-convert to the legacy API. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 12/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
About "query" and "filter": Your proposed mongoc_collection_find_with_opts takes a "query" parameter, and there's a "filter" field in mongoc_find_opts_t. Let's get rid of "filter" but keep "query". About "max_await_time_ms": Yes, that's right. We want a separate option in mongoc_find_opts_t called max_await_time_ms, we'll use it as the "maxTimeMS" argument to the "getMore" command if this is a tailable cursor with awaitData. Find, getMore And killCursors Commands Spec:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Hannes Magnusson [ 12/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copypasta fixed
Err. I thought I was being consistent with find_and_modify. I was wrong.
Not sure what you are talking about here?
Copypasta fixed
Copypasta fixed
Copypasta fixed
There is no such option for the find command.. You want to set it there and not using until getmore? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 11/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Great!
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Hannes Magnusson [ 11/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 10/Nov/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
bjori could you write down a proposed API here for setting readConcern? Including a new mongoc_collection_find_with_opts or whatever? Once we agree on the interface you can start implementing it from the top down while I approach from the bottom up. |