-
Type: Task
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Replication
For insert-only bulkWrite commands, errorsOnly:false doesn't provide any additional information compared to errorsOnly:true (summary mode). Therefore, any insert-only bulkWrite should always use errorsOnly:true as responses are much cheaper to produce in summary mode. This should be possible because inserts either succeed with n: 1, or fail with an error. It isn't possible for an insert to produce n: 0 while not having an associated error.
This is not true for updates / deletes because 1) they can no-op without an error and 2) touch more than one document when multi:true. Because of this we won't be able to figure out which update / delete contributed how much to the totals nModified and nDeleted. For example, for two updates [u1, u2] if we receive a single number nModified: 1 in summary mode, from this we cannot figure out whether u1 or u2 produced the modification.
The point of this work is to make the insert-only code path more performant. If somehow there is a way to make this work for updates and deletes as well, then that is great: we can completely get rid of errorsOnly:false.
Ideally, the driver itself will send errorsOnly:true when it sees that it is sending an insert-only bulkWrite.