We split bulk writes into batches by creating and sending smaller individual write commands with subsets of the bulk write. We do this by adding the bulk write bson documents to each new write command until that write command is "full", so that we don't exceed the max bson size specified by the server. However, as of C driver 1.11, we append the write concern to the write command after we have deemed it "full." This can lead to an invalid bson document that exceeds the max bson size when it reaches the server.
This bug was introduced in this change:
https://github.com/mongodb/mongo-c-driver/commit/806cddb2acde03f5462460491f38fa21332b7d97#diff-48f831a7962c26b4ba6a9c1472b8184fL486
- related to
-
CDRIVER-3310 OP_QUERY bulk write should not batch documents exceeding size of maxBsonObjectSize
- Backlog