The "hello" command was introduced in 5.0 and was intended as a replacement for the "isMaster" command. However, drivers still issue the initial connection handshake using an OP_QUERY isMaster command in some circumstances order to ensure that they can communicate with older servers. This is discussed in this section of the drivers' connection handshake specification:
The server's implementation of the client, however, does not need to connect to old server versions that do not support "hello" or OP_MSG. The server codebase's client implementations are also used inside the legacy mongo shell. The mongo shell became an internal test-only tool starting in 6.0, and therefore it also does not have to remain compatible with servers before 5.0 that either don't support "hello" or OP_MSG. For these reasons, it should be safe to make the AsyncDBClient and DBClientConnection always use "hello" rather than "isMaster".
Looking at the code, the AsyncDBClient always uses "isMaster" and can be changed to always use "hello" instead. The DBClientConnection uses "hello" if an API version is set but should change to use "hello" unconditionally.
- is duplicated by
-
SERVER-53034 Investigate internal usages of "isMaster" in sharding
- Closed
- is related to
-
SERVER-59300 Change AsyncDBClient to use OP_MSG for isMaster request rather than OP_QUERY
- Closed