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

w:0 not correctly handled in mongos for write commands

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 2.5.4
    • None
    • mongod/mongos 2.5.4
    • ALL
    • Hide

      //
      // Start a shard
      var s = new ShardingTest("count1", 2, 1);
      var db = s.getDB("test");
      var collectionName = "batch_write_protocol";
      var coll = db.getCollection(collectionName);
       
      jsTest.log("Starting sharded write command tests...");
       
      var request;
      var result;
       
      //
      // Single document upsert, write concern 0 specified, ordered = true
      request = {update : collectionName, updates: [
      	{q:{a:2}, u: {$set: {a:2}}, upsert:true}
      ], writeConcern: {w:0}, ordered:true};
      result = coll.runCommand(request)
      jsTest.log(JSON.stringify(result, null, 2))
      assert.eq(1, result.ok);
      assert.eq(1, result.n);
      assert(result.upserted == null);
       
      // Remove the data
      coll.remove({});

      Show
      // // Start a shard var s = new ShardingTest("count1", 2, 1); var db = s.getDB("test"); var collectionName = "batch_write_protocol"; var coll = db.getCollection(collectionName);   jsTest.log("Starting sharded write command tests...");   var request; var result;   // // Single document upsert, write concern 0 specified, ordered = true request = {update : collectionName, updates: [ {q:{a:2}, u: {$set: {a:2}}, upsert:true} ], writeConcern: {w:0}, ordered:true}; result = coll.runCommand(request) jsTest.log(JSON.stringify(result, null, 2)) assert.eq(1, result.ok); assert.eq(1, result.n); assert(result.upserted == null);   // Remove the data coll.remove({});

    Description

      w:0 write concern should not return errors or upserted items. mongos seems to incorrectly pass back the upserted items on w:0

      Attachments

        Activity

          People

            randolph@mongodb.com Randolph Tan
            christkv Christian Amor Kvalheim
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: