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

Skip handshake on stream establishment when using gRPC

    • Networking & Observability
    • Networking & Obs 2025-01-20, Egress gRPC 2025-01-31, Egress gRPC 2025-02-14
    • 200
    • 5

      Right now on stream establishment in TLConnection, we unconditionally perform the MongoDB handshake on each new connection (https://github.com/10gen/mongo/blob/72aff07b32ff4db49475493949823bf9694fc263/src/mongo/executor/connection_pool_tl.cpp#L434-L441) in order to exchange metadata/initialize the wire version. However, when gRPC is being used, we should instead prefer the metadata/wire version exchange protocol specified in the MongoDB gRPC protocol, which doesn't use a handshake and instead uses the gRPC metadata.

      Because gRPC uses roughly a stream per operation, it is bad for performance to do this handshake on each new stream, which is why we will instead use the metadata gossiping protocol.

      Configure TLConnection class to skip the handshake when gRPC is being used.

            Assignee:
            patrick.freed@mongodb.com Patrick Freed
            Reporter:
            erin.mcnulty@mongodb.com Erin McNulty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: