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

Inconsistent gle behavior between mongos and mongod

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major - P3 Major - P3
    • None
    • 2.6.0-rc2
    • Sharding
    • None
    • ALL

    Description

      Run the following in against the shell:

      var cmdObj = {
          update: 'user',
          updates: [
              { q: { none: 1 }, u: { _id: 0 }, upsert: true },
              { q: { none: 1 }, u: { _id: 1 }, upsert: true },
              { q: { none: 1 }, u: { _id: 2 }, upsert: true }
          ],
          ordered: false
      };
      db.runCommand(cmdObj);
      db.runCommand({ getLastError: 1 });

      mongos response:

      {
      	"err" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: test.user.$_id_  dup key: { : 0.0 }",
      	"code" : 11000,
      	"n" : 0,
      	"singleShard" : "localhost:30000",
      	"ok" : 1
      }

      mongod response:

      {
      	"connectionId" : 2,
      	"updatedExisting" : false,
      	"upserted" : 2,
      	"n" : 1,
      	"syncMillis" : 0,
      	"writtenTo" : null,
      	"err" : null,
      	"ok" : 1
      }

      Note: This appears to only happen on updates write command. In the case of insert, they both return the error when gle is called.

      Attachments

        Activity

          People

            randolph@mongodb.com Randolph Tan
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: