[SERVER-11633] w:0 not correctly handled in mongos for write commands Created: 08/Nov/13  Updated: 10/Dec/14  Resolved: 08/Jan/14

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.5.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Christian Amor Kvalheim Assignee: Randolph Tan
Resolution: Duplicate Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mongod/mongos 2.5.4


Issue Links:
Depends
Duplicate
duplicates SERVER-11969 w:0 on sharded write command is retur... Closed
Operating System: ALL
Steps To Reproduce:

//
// 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({});

Participants:

 Description   

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



 Comments   
Comment by Randolph Tan [ 08/Jan/14 ]

Note: script on description will fail because w:0 will only have ok field on no error.

Comment by Daniel Pasette (Inactive) [ 08/Jan/14 ]

verify with a test.

Generated at Thu Feb 08 03:26:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.