-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: mongodb-2.6, mongodb-3.0, mongodb-3.2
-
Component/s: manual
-
Labels:None
I reviewed the v2.6.8 code for selecting the members based on the read preference.
The nearest calculation is not used when using the "secondaryPreferred" read preference. In other words, the members selected are all secondaries and primaries regardless of ping times. If a secondary cannot be selected, then the primary is selected.
The nearest calculation is done when using the "secondary" read preference. See code.
This code has changed since 2.6.8. We should be clear about which read preferences cause the nearest calculation to be done.