The server selection spec states the following:
To always select the server with the lowest RTT, users should use mode 'nearest' without tag_sets or maxStalenessSeconds and set localThresholdMS to zero.
mongoc_topology_new() initializes its copy of localThresholdMS by calling mongoc_uri_get_option_as_int32(). which does not respect a zero value and instead returns the fallback of 15ms (as documented).
One solution may be to create a separate getter that respects zero, as was done with _mongoc_uri_get_max_staleness_option().
- is depended on by
-
PHPC-918 localThresholdMS of zero is not supported
- Closed
- is related to
-
CDRIVER-2060 localThresholdMS is not validated as a non-negative value
- Closed
- related to
-
CDRIVER-3730 Do not interpret URI option values of 0 as unset
- Backlog
-
CDRIVER-2057 localThresholdMS should default to 15 milliseconds
- Closed
- links to