[CDRIVER-2214] Throw errors in collection functions that write/read when a write/read concern is specified and maxWireVersion < 5 Created: 18/Jul/17 Updated: 28/Oct/23 Resolved: 09/Jan/18 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.10.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Patrick Freed | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||
| Description |
|
From the read/write concern spec:
The specific sentence the C Driver violates is: "If the helper accepts a write concern, the driver MUST error if the selected server's MaxWireVersion < 5 and a write concern has explicitly been specified." Most of the commands implement the second paragraph from the spec, but do not error out if one passes the write concern in via the options document. (e.g. collection_aggregate_with_opts). These commands should be changed so that if a writeConcern is passed in and maxWireVersion < 5, the driver will throw an error. Full list of these helper commands:
Likewise for readConcern, the spec says:
The driver implements this properly for aggregate_with_opts, but only silently fails with count, and does not seem to check at all for collection_find_with_opts. |
| Comments |
| Comment by Githook User [ 11/Jan/18 ] |
|
Author: {'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}Message: If aggregate is called with readConcern and the server is too old to |
| Comment by Githook User [ 10/Jan/18 ] |
|
Author: {'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}Message: |
| Comment by Githook User [ 09/Jan/18 ] |
|
Author: {'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}Message: Commands that write now conform to the drivers spec: it is an error to Commands that read now conform to the spec as well: it is an error to |
| Comment by A. Jesse Jiryu Davis [ 08/Jan/18 ] |
|
I'll start with enforcing the writeConcern wire version check.
|
| Comment by A. Jesse Jiryu Davis [ 18/Jul/17 ] |
|
Thanks for the report! |