-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 1.1.2
-
Component/s: None
-
None
Currently, _mongoc_write_concern_needs_gle() returns true only if w is neither 0 or -1. This function is used by both the legacy and write command code paths. If the user were to specify w:0 and j:true, the driver skips sending a GLE. Although an edge case, this is unfortunate in that the server would otherwise have upgraded that w:0 to w:1 in order to honor the j:true option. For write commands, if the user specifies any values for a write concern, they should be included in the command(s).
I believe there are also implications for replSetGetConfig.settings.getLastErrorDefaults, as that option kicks in only when the driver does not specify a write concern.
A fix will start with having the driver differentiate between false and unset values for journal and fsync_ on the write concern struct. From there, the logic for _mongoc_write_concern_needs_gle() and BSON serialization can be changed.
- is depended on by
-
PHPC-179 WriteConcern debug handler should denote unset journal/fsync options
- Closed
-
CDRIVER-581 URI parsing should not assume write concern defaults
- Closed
-
PHPC-178 WriteConcern should allow unset options
- Closed
- related to
-
PHPC-280 WriteConcern should always set journal/fsync boolean args
- Closed
-
CDRIVER-587 URI parsing logs warning on w < -1 but otherwise ignores it
- Closed
-
CDRIVER-590 Support readPreference connection string option
- Closed