Skip handshake on stream establishment when using gRPC

XMLWordPrintableJSON

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

      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
            Reporter:
            Erin McNulty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: