[SERVER-22637] OP_INSERT can fail when inserted document contains no _id Created: 16/Feb/16  Updated: 17/Feb/16  Resolved: 17/Feb/16

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 3.2.1
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Jeffrey Yemin Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-22167 Failed to insert document larger than... Closed
Operating System: ALL
Steps To Reproduce:

Standalone 3.2.1 mongod server.

I used a document that looks like this:

new BsonDocument('b', new BsonBinary(new byte[262131]))

I had to hack the Java driver to not automatically add an _id and to actually send an OP_INSERT to a 3.2 driver.

Participants:

 Description   

Calling getlasterror after inserting a 262144-byte document without an _id via OP_INSERT fails with code 1 and the following message:

Collection::insertDocument got document without _id for ns:JavaDriverTest.com.mongodb.operation.InsertOperationSpecification

A 262143-byte document succeeds, and so does a 3.0 server.

I don't see this as particularly severe because most drivers will automatically add an _id field to all documents before insertion.


Generated at Thu Feb 08 04:01:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.