Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-77154

Change server's internal client implementations to always use "hello" rather than "isMaster" for the connection handshake

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0, 6.0.7, 7.0.0-rc3
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • v7.0, v6.0
    • QE 2023-05-29, QE 2023-06-12

      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:

      https://github.com/mongodb/specifications/blob/474ddfcc335225df4410986be2b10ae41a736d20/source/mongodb-handshake/handshake.rst#connection-handshake

      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.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: