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

Ordered bulk insert operation don't act as ordered

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0-rc1
    • Component/s: Write Ops
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      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

            Assignee:
            martin.bligh Martin Bligh
            Reporter:
            ross.lawley Ross Lawley
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: