moped
moped copied to clipboard
"nearest" read preference does not use correct logic
Nearest as currently written will select the node with the absolute lowest latency. According to the MongoDB documentation, nearest is supposed to select a random node within secondaryAcceptableLatencyMS of the lowest latency node. This can cause an imbalance in reads against replica sets with multiple nearby members.