Hi,
I’m using golang driver 1.7.1 for change stream feature.
and I found the “server selector” here is not using LatencySelector
to check localThresholdMS
from connection string.
So it makes the bad consequences when using Global Cluster feature in MongoDB Atlas, the driver will select the “mongos” which is far away from the application. For my use case, the application in US is possibly using “mongos” in Japan.
I also checked the server selector used by collection.Find()
in here and I found it really follows rule in driver spec to use LatencySelector
and examine localThresholdMS
.
In addition, I found the MongoDB document states:
The driver will load balance randomly across the mongos instances that fall within the latency window
So I expect the server selector when using change stream should follow this rule.
Thanks,
Vincent