[CDRIVER-3630] Raise error when hint option is provided on unacknowledged writes against any server version Created: 20/Apr/20 Updated: 15/Jun/22 Resolved: 22/Jul/20 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Backlog - Core Eng Program Management Team | Assignee: | Andreas Braun |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
A previous version of the CRUD spec said that the driver should only raise errors when the hint option is provided to an unacknowledged write against a server that does not support the hint option. However, the CRUD spec also says that the driver should raise errors whenever the arrayFilters or collation options are provided on any unacknowledged write. The spec has been changed to state that the driver should raise an error when the hint option is provided on unacknowledged writes against any server version. |
| Comments |
| Comment by Githook User [ 21/Jun/21 ] |
|
Author: {'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}Message: CDRIVER-3895: Remove dots/dollars validation for insert/replace docs (#801)
Also replaces CRUD legacy/v2 tests with unified equivalents for Synced with mongodb/specifications@a124e21be89cbfc78606725c6ed1fa00dc992777
This adds top-level key validation to _mongoc_validate_replace, similar to what existed in _mongoc_validate_update.
Replacement docs will already be validated by _mongoc_validate_replace before this function is reached. This adds logic to ensure "q" and "u" documents are present, similar to what existed in _mongoc_write_command_delete_legacy.
The failure code path is testing that arguments are still validated by mongoc-util.c, despite replacement validation being removed in a previous commit.
This reverts commit bd014ee7995420d5d1d2db8a10348f0b24d09090.
Empty keys can be used as a reliable BSON validation error, since insert, replace, and update all specify BSON_VALIDATE_EMPTY_KEYS in their vflags. Error message expectations are adjusted accordingly. An _id document with a dollar-prefixed key is also used as a reliable server-side validation error.
Allow entire files to be skipped to preempt schema version errors.
Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com> |
| Comment by Githook User [ 16/Jun/21 ] |
|
Author: {'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}Message: CDRIVER-3895: Remove dots/dollars validation for insert/replace docs (#801)
Also replaces CRUD legacy/v2 tests with unified equivalents for Synced with mongodb/specifications@a124e21be89cbfc78606725c6ed1fa00dc992777
This adds top-level key validation to _mongoc_validate_replace, similar to what existed in _mongoc_validate_update.
Replacement docs will already be validated by _mongoc_validate_replace before this function is reached. This adds logic to ensure "q" and "u" documents are present, similar to what existed in _mongoc_write_command_delete_legacy.
The failure code path is testing that arguments are still validated by mongoc-util.c, despite replacement validation being removed in a previous commit.
This reverts commit bd014ee7995420d5d1d2db8a10348f0b24d09090.
Empty keys can be used as a reliable BSON validation error, since insert, replace, and update all specify BSON_VALIDATE_EMPTY_KEYS in their vflags. Error message expectations are adjusted accordingly. An _id document with a dollar-prefixed key is also used as a reliable server-side validation error.
Allow entire files to be skipped to preempt schema version errors.
Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com> |
| Comment by Jeremy Mikola [ 22/Jul/20 ] |
|
This was originally created to track DRIVERS-991, but that issue has been superseded by DRIVERS-1340. |
| Comment by Jeremy Mikola [ 22/Jul/20 ] |
|
andreas.braun: When I asked about this in Slack, I incorrectly associated https://github.com/mongodb/specifications/pull/774 (which you did review) with DRIVERS-991 instead of DRIVERS-970. The PR for DRIVERS-991 was https://github.com/mongodb/specifications/pull/789 (which you did not review). DRIVERS-991 and SPEC-1664 were both created after I'm going to re-open this and related CXX and PHPC language tickets for DRIVERS-991 and resolve them as "Won't Fix" in light of DRIVERS-1340. |
| Comment by Andreas Braun [ 22/Jul/20 ] |
|
Done in https://github.com/mongodb/mongo-c-driver/commit/1b9ce0d3d |