-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Server Security
-
ALL
Summary
When a non-load-balanced mongod receives a loadBalanced:true in the hello command, do not close the connection.
Background & Motivation
Drivers expect a non-load-balanced server to accept loadBalanced:true, and instead 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, mongod 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.
Latest 8.1 builds failed this driver test expecting the driver-side error. I expect the connection close is caused by this error check added to mongod in SERVER-85804.
This ticket requests restoring the old behavior (i.e. do not close connection). The driver-side error seems more informative than a connection close. Not closing a connection seems consistent with mongos behavior.
See also: slack conversation.
- is caused by
-
SERVER-85804 Support Proxy Protocol on Mongod
-
- Closed
-
- is depended on by
-
DRIVERS-3109 Revert skip to non-lb-connection-establishment
-
- Blocked
-
- related to
-
DRIVERS-3108 Investigate changes from SERVER-85804
-
- Implementing
-