Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-4117

Error earlier if server does not support load balanced mode

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Unknown Unknown
    • None
    • None
    • None
    • None

    Description

      Background & Motivation
      mongoc_cmd_parts_assemble currently checks if the topology description is load balanced when serializing a command for pre OP_MSG.

      This is necessary to prevent an assertion in mongoc_cmd_parts_assemble_mongod. That asserts that the topology type is not load balanced.

      In the scenario that the server is not a mongos and is a pre 3.6. _mongoc_cluster_stream_for_server will return an error with the message "Driver attempted to initialize in load balancing mode, but the server does not support this mode" if the server does not report a serviceId. But that error check only occurs after the authentication handshake is attempted.

      The check is necessary to avoid the assertion during the authentication handshake. A preferable change would be to check for the presence of serviceId before authentication is attempted. That would preclude mongoc_cmd_parts_assemble from ever being called with a non-mongos server in load balanced mode.

      Scope
      When in load balanced mode, check for the presence of a serviceId field before authentication occurs and return an error.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: