[SERVER-21093] Ordered bulk insert operation don't act as ordered Created: 23/Oct/15  Updated: 27/Oct/15  Resolved: 26/Oct/15

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: 3.2.0-rc1

Type: Bug Priority: Major - P3
Reporter: Ross Lawley Assignee: Martin Bligh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QuInt B (11/02/15)
Participants:

 Description   

The behaviour of ordered bulk operations has changed since 3.2.0-rc0.

Previously, if an ordered bulk operation failed then it stopped there, but it now inserts more.

Given the following test case more inserts are being inserted than in previous versions:

db.test.drop();
db.test.insert({_id: 50});  // Create a document to force a duplicate key exception.
 
var bulk = db.test.initializeOrderedBulkOp();
for (i = 1; i < 100; i++) { 
  bulk.insert( { _id: i } );
}
try {
  bulk.execute();
  assert(false, "should have failed due to duplicate key");
} catch(err) {
  assert(db.test.count() == 50, "Unexpected number inserted by bulk write");
}



 Comments   
Comment by Githook User [ 26/Oct/15 ]

Author:

{u'username': u'martinbligh', u'name': u'Martin Bligh', u'email': u'mbligh@mongodb.com'}

Message: SERVER-21093: Make ordered bulk insert operation error out properly
Branch: master
https://github.com/mongodb/mongo/commit/b9c5d9f97d63429c36cb9027b6fc1594b67373a9

Comment by Martin Bligh [ 23/Oct/15 ]

Thanks for the very distilled bug report - made it trivial to see exactly what was going on. Will post fix shortly.

Generated at Thu Feb 08 03:56:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.