[CDRIVER-2410] _mongoc_client_command_with_opts omits client write concern for findAndModify on 3.2 Created: 27/Nov/17 Updated: 28/Oct/23 Resolved: 05/Dec/17 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.9.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeremy Mikola | 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: |
|
||||||||||||
| Description |
|
_mongoc_client_command_with_opts() includes the following logic to append the client's write concern:
Before this logic, mongoc_cmd_parts_append_opts() is called. That function has logic to ignore "writeConcern" in opts if the wire version does not support the option. Per the Server Wire version and Feature List, the "writeConcern" option is supported with wire version >= 4 for findAndModify and >= 5 for other commands, which correlate with server versions 3.2+ and 3.4+, respectively. The current logic in _mongoc_client_command_with_opts() only applies the client's write concern for wire version >= 5, which means that executing a findAndModify command via one of these helpers (likely read_write_command_with_opts) will omit a write concern on 3.2. This could be relevant for |
| Comments |
| Comment by Githook User [ 05/Dec/17 ] |
|
Author: {'username': 'ajdavis', 'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis'}Message: If mongoc_client_read_write_command_with_opts or similar function is |
| Comment by Jeremy Mikola [ 04/Dec/17 ] |
|
jesse: I don't recall if we discussed it, but this would also make a fine low-hanging-fruit ticket for one of the new grads. |
| Comment by A. Jesse Jiryu Davis [ 04/Dec/17 ] |
|
jmikola I can't remember: do you plan to do this, or shall I? |
| Comment by Jeremy Mikola [ 27/Nov/17 ] |
|
Related to documentation changes in The docs for the various command_with_opts functions previously stated "The write concern is omitted for MongoDB before 3.2" and I was in the process of changing that to "The write concern is omitted for MongoDB before 3.4 (or 3.2 for "findAndModify")". Without this issue, the correct documentation would need to be: "The write concern in opts is ignored for MongoDB before 3.4 (or 3.2 for "findAndModify"). The write concern from client is ignored for MongoDB before 3.4." |