[SERVER-12954] w parameter is not propagated correctly when calling getLastError on compatibility writeMode Created: 27/Feb/14  Updated: 11/Jul/16  Resolved: 14/Mar/14

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

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

Issue Links:
Depends
depends on SERVER-13049 Inconsistent gle behavior between mon... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Send this commands through a shell connect to mongos:

db.use.insert({x:1})
db.runCommand({ getLastError: 1, w: 'adf' })

results with writeMode commands/legacy:

{
	"n" : 0,
	"errmsg" : "could not enforce write concern :: caused by :: BadValue cannot use non-majority 'w' mode adf when a host is not a member of a replica set",
	"ok" : 0
}

results with compatibility:

{
	"n" : 0,
	"shards" : [ ],
	"shardRawGLE" : {
		
	},
	"err" : null,
	"ok" : 1
}



 Comments   
Comment by Githook User [ 14/Mar/14 ]

Author:

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

Message: SERVER-12954 w parameter is not propagated correctly on compatibility writeMode

Send resetError only when absolutely necessary.
Branch: v2.6
https://github.com/mongodb/mongo/commit/3b7aae27fef10e3359ea6164164e827ff5407c61

Comment by Githook User [ 14/Mar/14 ]

Author:

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

Message: SERVER-12954 w parameter is not propagated correctly on compatibility writeMode

Send resetError only when absolutely necessary.
Branch: master
https://github.com/mongodb/mongo/commit/e44682821c37fdf3d4fd8cb58dcf5c34181ddbde

Comment by Randolph Tan [ 28/Feb/14 ]

This is a a problem in all cases - example is stand alone for simplicity.

Comment by Eric Milkie [ 28/Feb/14 ]

So is it a problem only in the error case when you try to use a tagged write concern without a replica set? Or is it for all tagged write concerns in compat mode?

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