-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
Labels:
-
Fully Compatible
-
Repl 2019-10-21, Repl 2019-11-04, Repl 2019-11-18
Currently, WriteConcernOptions::parse is a member function of WriteConcernOptions. And in the parse function, it assigns new value to some (but not all) member variables of WriteConcernOptions. This makes it hard to reason about what is the state of the object if parse fails. And in some places (mostly in test), we have to make an instance of the WriteConcernOptions in order to use the parse function. I think it is a better practice to make it a static function returning StatusWith<WriteConcernOptions>. By doing so, it also makes the function easier to use.