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

Cryptic error when trying to update with a valid big document

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.7.0
    • Affects Version/s: 2.6.0-rc1
    • Component/s: Shell
    • None
    • ALL

      Running the code below:

      var maxBsonObjectSize = db.isMaster().maxBsonObjectSize;
      var docOverhead = Object.bsonsize({ _id: new ObjectId(), x: '' });
      var maxStrSize = maxBsonObjectSize - docOverhead;
      
      var maxStr = 'a';
      while (maxStr.length < maxStrSize) maxStr += 'a';
      
      var coll = db.max_doc_size;
      
      coll.drop();
      var id = new ObjectId();
      coll.insert({ _id: id });
      assert.writeOK(coll.update({ _id: id }, { $set: { x: maxStr }}));
      

      Results in the shell throwing "Cannot output SingleWriteResult from multiple batch result". This appears to be a problem in the splitting logic inside the addToOperationsList method in bulk_api.js.

            Assignee:
            Unassigned Unassigned
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: