[SERVER-11969] w:0 on sharded write command is returning upserted values Created: 05/Dec/13  Updated: 11/Jul/16  Resolved: 20/Dec/13

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

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

Issue Links:
Depends
Duplicate
is duplicated by SERVER-11633 w:0 not correctly handled in mongos f... 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))
return 
assert.eq(1, result.ok);
assert.eq(1, result.n);
assert(result.upserted == null);

Participants:

 Description   

When performing a write command with write concern w:0 it should not return either errDetails or upserts as w:0 indicates no information wanted and is meant to assure a fixed size return document to minimize wire transport size.



 Comments   
Comment by Githook User [ 20/Dec/13 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-11969 w:0 on sharded write command is returning upserted values
Branch: master
https://github.com/mongodb/mongo/commit/3c9c156fa0aa4416310d043887528fc46a09820b

Comment by Greg Studer [ 06/Dec/13 ]

What should come back is "ok", "n", "code", and "errmsg".

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