-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.0.0-beta1
-
Component/s: None
-
None
Currently, WriteConcern checks if $w is a numeric string (with is_numeric_string(). If so, it considers it as the integer acknowledgement level. This is problematic, since the user could have a custom write concern that is a numeric string:
REPLICASET:PRIMARY> conf.settings = { getLastErrorModes: { "2" : { "foo":1 }}} { "getLastErrorModes" : { "2" : { "foo" : 1 } } } REPLICASET:PRIMARY> conf.members[0].tags = { "foo":"bar"} { "foo" : "bar" } REPLICASET:PRIMARY> rs.reconfig(conf) { "ok" : 1 } REPLICASET:PRIMARY>
I propose we change the zpp format to accept a zval, use integers and strings as-is (without any conversion), and throw InvalidArgumentException on other types.