Error earlier if server does not support load balanced mode

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Unassigned
            Reporter:
            Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: