Specify behavior with unacknowledged writes for MongoClient.bulkWrite:
Return error if verbose results are requested.
Return error if ordered writes are requested.
Apply w:0 to each batch.
Existing spec and prose tests using MongoClient.bulkWrite with unacknowledged write concern have been updated to use ordered: false. The default (ordered: true) is now expected to result in a client-side error.
Background & Motivation
See DRIVERS-2993 for motivation.
This PR expects the OP_MSG moreToCome bit is always set for all batches. This agrees with OP_MSG:
Clients doing unacknowledged writes MUST set the moreToCome flag, and MUST set the writeConcern to w=0.
Prose Test
A CRUD prose test is added to insert 100,001 documents with w:0 write concern to test multi-batch unacknowledged write.
The resulting collection count is checked to ensure the unacknowledged writes completes and avoid interfering with later tests. This was similarly done in DRIVERS-2877.
The prose test includes a step to create the collection with the create command as a workaround for SERVER-95537.
Please complete the following before merging:
[x] Update changelog.
[x] Make sure there are generated JSON files from the YAML test files.
[x] Test changes in at least one language driver.
[x] Test these changes against all server versions and topologies (including standalone, replica set, sharded
clusters, and serverless).
Summary
Specify behavior with unacknowledged writes for
MongoClient.bulkWrite
:w:0
to each batch.Existing spec and prose tests using
MongoClient.bulkWrite
with unacknowledged write concern have been updated to useordered: false
. The default (ordered: true
) is now expected to result in a client-side error.Background & Motivation
See DRIVERS-2993 for motivation.
This PR expects the OP_MSG moreToCome bit is always set for all batches. This agrees with OP_MSG:
Prose Test
A CRUD prose test is added to insert 100,001 documents with
w:0
write concern to test multi-batch unacknowledged write.The resulting collection count is checked to ensure the unacknowledged writes completes and avoid interfering with later tests. This was similarly done in DRIVERS-2877.
The prose test includes a step to create the collection with the
create
command as a workaround for SERVER-95537.Please complete the following before merging:
Tests verified with the C driver in https://github.com/mongodb/mongo-c-driver/pull/1752