-
Type: Bug
-
Resolution: Fixed
-
Priority: Critical - P2
-
Affects Version/s: 1.1.1
-
Component/s: Wire Protocol
-
None
Here is a gist of the program I used to attempt to insert a 16 MiB document: https://gist.github.com/tfogo/fea1a80c565f7e97f7464c6b0c39640f
Running this results in this output:
ERROR: an inserted document is too large
This error is due to this line:
This line is reducing the space available for documents in a message. The comment implies this is to make space for commands. But messages can be larger than 16 MiB (48 MB by default) so I believe it's incorrect to reserve space for commands that should be used for documents.
I tested reducing reservedCommandBufferBytes to 0. This allows all documents up to 16 MiB in size to be inserted. However, trying to insert a document that is exactly 16 MiB causes another error:
ERROR: (Location40414) BSON field 'insert.documents' is missing but a required field
This error comes from the server. It looks like the OP_MSG sent to the server could be malformed.
- related to
-
GODRIVER-2936 Bulk inserting many documents causes BSONObjectTooLarge error unexpectedly
- Closed