@@ -9,7 +9,7 @@ Load Balancer Support
9
9
:Status: Accepted
10
10
:Type: Standards
11
11
:Minimum Server Version: 5.0
12
- :Last Modified: 2021-12-22
12
+ :Last Modified: 2022-01-18
13
13
14
14
.. contents ::
15
15
@@ -163,8 +163,10 @@ Connection Establishment
163
163
164
164
In the case of the driver having the :code: `loadBalanced=true ` connection string option
165
165
specified, every pooled connection MUST add a :code: `loadBalanced ` field to the
166
- :code: `hello ` or legacy hello command in its `handshake <../mongodb-handshake/handshake.rst#connection-handshake >`__.
167
- The value of the field MUST be :code: `true `.
166
+ :code: `hello ` command in its `handshake <../mongodb-handshake/handshake.rst#connection-handshake >`__.
167
+ The value of the field MUST be :code: `true `. If :code: `loadBalanced=true ` is
168
+ specified then the ``OP_MSG `` protocol MUST be used for all steps of the
169
+ connection handshake.
168
170
169
171
Example:
170
172
@@ -263,7 +265,7 @@ Initial Handshake Errors
263
265
264
266
When establishing a new connection in load balanced mode, drivers MUST NOT perform SDAM
265
267
error handling for any errors that occur before the MongoDB Handshake
266
- (i.e. :code: `hello ` or legacy hello command) is complete. Errors during the MongoDB
268
+ (i.e. :code: `hello ` command) is complete. Errors during the MongoDB
267
269
Handshake MUST also be ignored for SDAM error handling purposes. Once the initial
268
270
handshake is complete, the connection MUST determine its generation number based
269
271
on the :code: `serviceId ` field in the handshake response. Any errors that occur
@@ -308,7 +310,7 @@ All services which terminate TLS MUST be configured to return a TLS certificate
308
310
which matches the hostname the client is connecting to.
309
311
310
312
All services behind a load balancer that have been started with the aforementioned option MUST
311
- add a top level :code: `serviceId ` field to their response to the :code: `hello ` or legacy hello
313
+ add a top level :code: `serviceId ` field to their response to the :code: `hello `
312
314
command. This field MUST be a BSON :code: `ObjectId ` and SHOULD NOT change while the service is running.
313
315
When a driver is configured to not be in load balanced mode and the service is configured behind
314
316
a load balancer, the service MAY return an error from the driver's :code: `hello ` command that
@@ -342,7 +344,7 @@ Why explicitly opt-in to this behaviour instead of letting mongos inform the dri
342
344
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
343
345
344
346
Other versions of this design proposed a scheme in which the application does not have to opt-in to
345
- load balanced mode. Instead, the server would send a special field in :code: `hello ` and legacy hello
347
+ load balanced mode. Instead, the server would send a special field in :code: `hello `
346
348
command responses to indicate that it was running behind a load balancer and the driver would change
347
349
its behavior accordingly. We opted to take an approach that required code changes instead because
348
350
load balancing changes driver behavior in ways that could cause unexpected application errors, so
@@ -424,6 +426,6 @@ be supported.
424
426
425
427
Change Log
426
428
==========
427
-
429
+ - 2022-01-18: Clarify that `` OP_MSG `` must be used in load balanced mode.
428
430
- 2021-12-22: Clarify that pinned connections in transactions are exclusive.
429
431
- 2021-10-14: Note that ``loadBalanced=true `` conflicts with ``srvMaxHosts ``.
0 commit comments