Client is connecting to unexpected replicas with readPreference: nearest; round trip time seems wrong

Hi,

I have a replica set with some replicas in the US and some replicas in the EU. I have a Node.js client using Node.js driver 4.17.1 connecting to the replica set with readPreference: nearest. We have the default localThresholdMS of 15. We expect that clients in the US and EU will exclusively read from their local replicas. We’ve confirmed that pings from the clients to their local replicas routinely complete in <2 ms, and pings from clients to the other (non-local) replicas routinely complete in >80 ms. So, there seems to be no reason for an EU client to read from a US replica.

However, what we’re observing is: US clients always read from US replicas, but EU clients distribute their reads across US and EU replicas.

One last interesting thing to add to the mix: we have logging that reports the duration of server heartbeats (the duration in the “serverHeartbeatSucceeded” event). This duration is consistently 0 ms across all clients and all replicas. This seems incorrect, but I am not sure if I am misinterpreting this value. I am wondering if this is somehow related.

I would appreciate any ideas any of you may have. Thank you!