Summary
The existing tests for writeConcern imply that an empty document is a valid writeConcern to send to the server.
In fact, the default writeConcern is no writeConcern (i.e. don't send the writeConcern field at all). This has come up in the past related to drivers accidentally overriding getLastErrorDefaults. It is coming up again in relation to PM-900.
There have been two bugs filed and fixed in drivers related to this - CDRIVER-2273 and PYTHON-1523. Other drivers may have the same bug, since our existing tests don't catch it.
Please add tests to ensure that drivers don't add the writeConcern option with an empty document to write commands when the application has not specified a write concern.
Lead : Jeremy
Author : Kevin
POCs : C - Kevin
Spec test change
SPEC-1352 introduces a new spec test format for the read/write concern tests, mostly equivalent to existing transactions/CRUD spec tests, to verify that write operations do not include a default write concern:
- depends on
-
NODE-2291 Improve testing around default writeConcern
- Closed
-
CDRIVER-3426 Improve testing around default writeConcern
- Closed
-
CXX-1875 Improve testing around default writeConcern
- Closed
-
MOTOR-456 Improve testing around default writeConcern
- Closed
-
PHPLIB-536 Improve testing around default writeConcern
- Closed
-
PYTHON-2037 Improve testing around default writeConcern
- Closed
-
RUST-367 Improve testing around default writeConcern
- Closed
-
CSHARP-2841 Improve testing around default writeConcern
- Closed
-
GODRIVER-1398 Improve testing around default writeConcern
- Closed
-
JAVA-3499 Improve testing around default writeConcern
- Closed
-
RUBY-2002 Improve testing around default writeConcern
- Closed
- is related to
-
DRIVERS-1565 Investigate changes in PM-2130: Change the Default Write Concern to Majority
- Development Complete