Details
-
Improvement
-
Resolution: Won't Fix
-
Major - P3
-
None
-
3.2.0-rc2
-
None
-
Sharding
Description
mongos> db.test.runCommand({count: "test", query: {}, readConcern: {level: "majority"}})
|
{
|
"shards" : {
|
|
},
|
"cause" : {
|
"ok" : 0,
|
"errmsg" : "Majority read concern requested, but server was not started with --enableMajorityReadConcern.",
|
"code" : 148
|
},
|
"code" : 148,
|
"ok" : 0,
|
"errmsg" : "failed on : sh01"
|
}
|
Same applies to aggregate and I imagine the others
mongos> db.test.runCommand({count: "aggregate", pipeline: {}, readConcern: {level: "majority"}})
|
{
|
"shards" : {
|
|
},
|
"cause" : {
|
"ok" : 0,
|
"errmsg" : "Majority read concern requested, but server was not started with --enableMajorityReadConcern.",
|
"code" : 148
|
},
|
"code" : 148,
|
"ok" : 0,
|
"errmsg" : "failed on : sh01"
|
}
|
Most/all drivers only expose the "errmsg", which results in the cryptic "failed on: sh01" error message being all the users see.
The cause.errmsg should probably overwrite the top-level errmsg similarly to how find does it:
mongos> db.test.runCommand({find: "test", filter: {}, readConcern: {level: "majority"}})
|
{
|
"ok" : 0,
|
"errmsg" : "Majority read concern requested, but server was not started with --enableMajorityReadConcern.",
|
"code" : 148
|
}
|