Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-3108

Investigate changes from SERVER-85804

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Component/s: Load Balancer
    • None
    • Needed
    • Hide

      Sync non-lb-connection-establishment test to this commit to avoid test failures with latest 8.1 servers due to SERVER-101078.

      Show
      Sync non-lb-connection-establishment test to this commit to avoid test failures with latest 8.1 servers due to SERVER-101078 .
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-5900 Fixed 2.0.0
      CXX-3225 Backlog
      CSHARP-5499 Done 3.2.1
      GODRIVER-3485 Needs Triage
      JAVA-5791 Fixed 5.4.0
      NODE-6771 In Code Review
      MOTOR-1433 Duplicate
      PYTHON-5142 Fixed 4.12
      PHPLIB-1629 Needs Triage
      RUBY-3624 Needs Triage
      RUST-2160 Fixed 3.3.0
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } #scriptField td.willNotDo { background-color: #FF0000; /* Red color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-5900 Fixed 2.0.0 CXX-3225 Backlog CSHARP-5499 Done 3.2.1 GODRIVER-3485 Needs Triage JAVA-5791 Fixed 5.4.0 NODE-6771 In Code Review MOTOR-1433 Duplicate PYTHON-5142 Fixed 4.12 PHPLIB-1629 Needs Triage RUBY-3624 Needs Triage RUST-2160 Fixed 3.3.0

      Summary

      Address a test failure in non-lb-connection-establishment on latest 8.1 server builds. The test failure appears related to SERVER-85804.

      Details

      SERVER-85804 changes a mongod to close load balanced connections if mongod was not configured to be load balanced.

      This causes a test failure in the spec test: non-lb-connection-establishment.
      Drivers expect a non-LB server to accept {hello: 1, loadBalanced: true}, and to then raise a driver-side error. From spec:

      When the server’s hello response does not contain a serviceId field, the driver MUST throw an exception with the message “Driver attempted to initialize in load balancing mode, but the server does not support this mode.”

      On latest 8.1 builds, the server appears to close the connection. With a non-LB server:

      $ mongosh --eval "db.version()"
      8.1.0-alpha0-451-gde379ff
      $ mongosh "mongodb://localhost:27017/?loadBalanced=true"  --eval "db.runCommand({'ping': 1})"
      MongoNetworkError: connection 5 to 127.0.0.1:27017 closed
      

      Compared with an 8.0 server:

      $ mongosh --eval "db.version()"
      8.0.5-rc2
      $ mongosh "mongodb://localhost:27017/?loadBalanced=true"  --eval "db.runCommand({'ping': 1})"
      MongoCompatibilityError: Driver attempted to initialize in load balancing mode, but the server does not support this mode.
      

      Motivation

      Who is the affected end user?

      DBX devs, and users mistakenly setting loadBalanced=true in the URI when connecting to a non-LB server.

      How does this affect the end user?

      The connection close might be less informative than the driver error. Though the mongod log indicates the cause:

      Mongod does not support load-balanced connections

      How likely is it that this problem or use case will occur?

      Certain.

      If the problem does occur, what are the consequences and how severe are they?

      Possibly confusing error.

      Is this issue urgent?

      Fixing the test failures for drivers is urgent to unblock testing latest server builds.

      Is this ticket required by a downstream team?

      No?

      Is this ticket only for tests?

      Maybe. If the decision is "this is the expected behavior", then yes.

      Acceptance Criteria

      • Ensure the non-lb-connection-establishment test passes in drivers testing servers containing SERVER-85804.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Kevin Albertson Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: