When InsertBatch is called with more documents than can fit in a single message to the server it breaks up the large batch into smaller sub-batches that do fit into a single message.
To maintain the semantics that a batch stops as soon as the first error is encountered (when ContinueOnError is false) InsertBatch must call GLE after all sub-batches (except perhaps the last) even if WriteConcern is Unacknowledged. Otherwise it wouldn't know that an error occurred and that it should stop sending any additional sub-batches.
- is related to
-
DRIVERS-1888 Split legacy batch inserts into many messages
- Closed