Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-21093

Ordered bulk insert operation don't act as ordered

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.2.0-rc1
    • Write Ops
    • None
    • Fully Compatible
    • ALL
    • QuInt B (11/02/15)

    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");
      }
      

      Attachments

        Activity

          People

            martin.bligh Martin Bligh
            ross@mongodb.com Ross Lawley
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: