-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
Call ismaster on each new connection and store the results on the SocketInfo instance.
The upcoming Authentication Spec says:
If credentials exist, upon opening a socket, drivers MUST send an isMaster command immediately. This allows a driver to determine whether the server is an Arbiter.
Calling ismaster additionally allows the driver to know if the default authentication method for each socket is MONGODB-CR or SCRAM-SHA-1, avoiding races when the driver repopulates the pool after a disconnect.
In theory we could choose not to call ismaster if there are no credentials, but it's simpler always to call ismaster, and paves the way for future breaking changes to the wire protocol besides the current breaking change to authentication.