Details
-
Improvement
-
Status: Backlog
-
Major - P3
-
Resolution: Unresolved
-
None
-
None
Description
This ticket is an extension to SERVER-18407 to cover custom write concern settings with replica set tags.
As with SERVER-18407, it is presently possible to create a custom write concern setting using replica set tags that is impossible to be satisfied. For example:
> rs.conf()
|
...
|
"members": [
|
{
|
"_id": 0
|
"tags": {
|
"ssd": "installed"
|
}
|
},
|
{
|
"_id": 1
|
"tags": {
|
"ssd": "installed"
|
}
|
}
|
],
|
"settings": {
|
"getLastErrorModes": {
|
"ssdWriteConcern": {
|
"ssd": 2
|
}
|
}
|
}
|
Please note the identical "ssd": "installed" tag defined in the replica set members.
Using this setting, attempts to insert into the collection using the user-defined custom write concern of w: ssdWriteConcern will always fail. The server apparently counts the number of unique values in the associated replica set tags to determine that the write concern was satisfied:
> db.test.insert({a:1},{writeConcern:{w:'ssdWriteConcern'}})
|
Inserted 1 record(s) in 3ms
|
WriteResult({
|
"nInserted": 1,
|
"writeConcernError": {
|
"code": 100,
|
"codeName": "CannotSatisfyWriteConcern",
|
"errmsg": "Not enough nodes match write concern mode \"ssdWriteConcern\""
|
}
|
})
|
The desired behaviour is to output a similar error message as per SERVER-18407 if the write concern can never be satisfied given a replica set configuration.
Attachments
Issue Links
- is related to
-
DOCS-10032 Clarify the semantics of replica set tags
-
- Closed
-
-
SERVER-18407 Ensure getLastErrorDefaults/getLastErrorModes are satisfiable
-
- Closed
-