[SERVER-13049] Inconsistent gle behavior between mongos and mongod Created: 05/Mar/14  Updated: 16/Jul/14  Resolved: 16/Jul/14

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.6.0-rc2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Randolph Tan
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-12954 w parameter is not propagated correct... Closed
Operating System: ALL
Participants:

 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.



 Comments   
Comment by Randolph Tan [ 09/Jul/14 ]

I can't seem to reproduce this again in master or 2.6.0-rc2. The error in mongos looks weird too - there shouldn't be a duplicate key error unless there's already data in the shards... Perhaps this was my own user error.

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