Skip to content

Commit 5964709

Browse files
npentreljeff-allen-mongo
authored andcommitted
DOCS-14167 ReplicaSetMatching default to disabled
1 parent b2164e2 commit 5964709

File tree

3 files changed

+130
-30
lines changed

3 files changed

+130
-30
lines changed

source/reference/command/connPoolStats.txt

+33-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ The command returns the output of the following form:
8686
"totalAvailable" : <num>,
8787
"totalCreated" : <num>,
8888
"totalRefreshing" : <num>,
89+
"replicaSetMatchingStrategy" : <string>,
8990
"pools" : {
9091
"NetworkInterfaceTL-TaskExecutorPool-0" : {
9192
"poolInUse" : <num>,
@@ -300,7 +301,6 @@ The command returns the output of the following form:
300301
"signature" : <document>
301302
},
302303
"operationTime" : <timestamp>
303-
304304
}
305305

306306
Output
@@ -331,6 +331,38 @@ Output
331331
members of the :term:`sharded cluster` or :term:`replica set` that
332332
are currently being refreshed.
333333

334+
.. data:: connPoolStats.replicaSetMatchingStrategy
335+
336+
.. versionadded:: 5.0 (*Also available starting in 4.4.5 and 4.2.13*)
337+
338+
On a :binary:`~bin.mongos` instance, this value reports the policy
339+
used by the instance to determine the minimum size limit of its
340+
connection pools to nodes within replica sets.
341+
342+
On a :binary:`~bin.mongod` instance, this value reports the policy
343+
used by the instance to determine the minimum size limit of its
344+
connection pools to nodes within *other* replica sets.
345+
346+
The policy for :binary:`~bin.mongos` and :binary:`~bin.mongod` can be
347+
set with the :parameter:`ShardingTaskExecutorPoolReplicaSetMatching`
348+
parameter.
349+
350+
.. note::
351+
352+
If the :parameter:`ShardingTaskExecutorPoolReplicaSetMatching` is
353+
set to ``"automatic"``, the
354+
:data:`~connPoolStats.replicaSetMatchingStrategy` still describes
355+
the actual policy being used, not ``"automatic"``. To find the
356+
value of the
357+
:parameter:`ShardingTaskExecutorPoolReplicaSetMatching`, use
358+
:dbcommand:`getParameter` which returns the value of the server
359+
parameter:
360+
361+
.. code-block:: javascript
362+
363+
db.adminCommand( { getParameter : 1, "ShardingTaskExecutorPoolReplicaSetMatching" : 1 } )
364+
365+
334366
.. data:: connPoolStats.numClientConnection
335367

336368
Reports the number of active and stored outgoing **synchronous**

source/reference/parameters.txt

+86-29
Original file line numberDiff line numberDiff line change
@@ -3019,46 +3019,97 @@ Sharding Parameters
30193019
.. parameter:: ShardingTaskExecutorPoolReplicaSetMatching
30203020

30213021
.. versionadded:: 4.2
3022+
.. versionchanged:: 5.0 (*Also starting in 4.4.5 and
3023+
4.2.13*)
30223024

30233025
Type: string
30243026

3025-
Default: "matchPrimaryNode"
3027+
Default: "automatic"
30263028

30273029
|both|
3028-
3029-
The policy that determines the minimum size limit of the
3030-
:binary:`~bin.mongos` instance's connection pools to the sharded
3031-
cluster's replica set secondaries.
3030+
3031+
On a :binary:`~bin.mongos` instance, this parameter sets the policy
3032+
that determines the minimum size limit of its connection pools to
3033+
nodes within replica sets.
3034+
3035+
On a :binary:`~bin.mongod` instance, this parameter sets the policy
3036+
that determines the minimum size limit of its connection pools to
3037+
nodes within *other* replica sets.
3038+
3039+
Note that this parameter only manages connections for operations that
3040+
are directly related to user requests and CRUD operations.
30323041

30333042
Available values are:
3034-
3043+
30353044
.. list-table::
30363045
:header-rows: 1
30373046
:widths: 15 85
3038-
3047+
30393048
* - Matching Policy
30403049
- Description
30413050

3042-
* - ``"matchPrimaryNode"`` (Default)
3043-
3044-
- For each replica set in the sharded cluster (specifically,
3045-
shard replica set and config servers), the minimum size limit
3046-
of the :binary:`~bin.mongos` instance's connection pool to
3047-
each secondary of that replica set is equal to the size of its
3048-
connection pool to the primary.
3051+
* - ``"automatic"`` (Default)
3052+
3053+
- Starting in 5.0 (and 4.4.5 and 4.2.13), ``"automatic"`` is the
3054+
new default value.
3055+
3056+
When set for a :binary:`~bin.mongos`, the instance follows the
3057+
behavior specified for the ``"matchPrimaryNode"`` option.
30493058

3050-
In case of primary stepdown, ``matchPrimaryNode`` ensures
3059+
When set for a :binary:`~bin.mongod`, the instance follows the
3060+
behavior specified for the ``"disabled"`` option.
3061+
3062+
.. note::
3063+
3064+
If the
3065+
:parameter:`ShardingTaskExecutorPoolReplicaSetMatching` is
3066+
set to ``"automatic"``, the
3067+
:data:`~connPoolStats.replicaSetMatchingStrategy` still
3068+
describes the actual policy being used, not
3069+
``"automatic"``. To find the value of the
3070+
:parameter:`ShardingTaskExecutorPoolReplicaSetMatching`,
3071+
use :dbcommand:`getParameter` which returns the value of
3072+
the server parameter.
3073+
3074+
* - ``"matchPrimaryNode"``
3075+
3076+
- When set for a :binary:`~bin.mongos`, the minimum size limit
3077+
of the instance's connection pool to each secondary of a
3078+
replica set in the sharded cluster (specifically, shard
3079+
replica set and config servers) is equal to the size of its
3080+
connection pool to that replica set's primary.
3081+
3082+
When set for a :binary:`~bin.mongod`, the minimum size limit
3083+
of the instance's connection pool to each secondary of
3084+
another replica set in the sharded cluster (specifically,
3085+
shard replica set and config servers) is equal to the size of
3086+
its connection pool to that replica set's primary.
3087+
3088+
.. warning::
3089+
3090+
If multiple shard servers in your topology can experience a
3091+
rapid influx of cross-shard operations, do not set this
3092+
option on your :binary:`~bin.mongod` instances.
3093+
3094+
In case of a primary stepdown, ``matchPrimaryNode`` ensures
30513095
that any secondary that becomes the primary can handle the
30523096
current level of primary reads and writes.
30533097

30543098
* - ``"matchBusiestNode"``
30553099

3056-
- For each replica set in the sharded cluster (specifically,
3057-
shard replica set and config servers), the minimum size limit
3058-
of the :binary:`~bin.mongos` instance's connection pool to
3059-
each member of that replica set is equal to the largest among
3060-
the active connections counts to the primary and each
3061-
secondary members.
3100+
- When set for a :binary:`~bin.mongos`, the instance's minimum
3101+
size limit of the connection pool to each member of a replica
3102+
set in the sharded cluster (specifically, shard replica set
3103+
and config servers) is equal to the largest among the active
3104+
connection counts to the primary and each secondary member of
3105+
that replica set.
3106+
3107+
When set for a :binary:`~bin.mongod`, the instance's minimum
3108+
size limit of the connection pool to each member of another
3109+
replica set in the sharded cluster (specifically, shard
3110+
replica set and config servers) is equal to the largest among
3111+
the active connection counts to the primary and each
3112+
secondary member of that replica set.
30623113

30633114
With ``"matchBusiestNode"``, :binary:`~bin.mongos` maintains
30643115
enough connections to each secondary to handle the current
@@ -3068,26 +3119,32 @@ Sharding Parameters
30683119

30693120
* - ``"disabled"``
30703121

3071-
- For each replica set in the sharded cluster (specifically,
3072-
shard replica set and config servers), the minimum number of
3073-
connections in the :binary:`~bin.mongos` instance's connection
3074-
pool to each secondary is equal to the
3075-
:parameter:`ShardingTaskExecutorPoolMinSize`.
3122+
- When set for a :binary:`~bin.mongos`, the instance's minimum
3123+
number of connections in the instance's connection pool to
3124+
each node of a replica set in the sharded clusterv
3125+
(specifically, shard replica set and config servers) is equal
3126+
to the :parameter:`ShardingTaskExecutorPoolMinSize`.
3127+
3128+
When set for a :binary:`~bin.mongod`, the instance's minimum
3129+
number of connections in the instance's connection pool to
3130+
each node of another replica set in the sharded cluster
3131+
(specifically, shard replica set and config servers) is equal
3132+
to the :parameter:`ShardingTaskExecutorPoolMinSize`.
30763133

30773134
The following example sets the
30783135
:parameter:`ShardingTaskExecutorPoolReplicaSetMatching` to
3079-
``"matchBusiestNode"`` during startup:
3136+
``"automatic"`` during startup:
30803137

30813138
.. code-block:: sh
30823139

3083-
mongod --setParameter ShardingTaskExecutorPoolReplicaSetMatching="matchBusiestNode"
3140+
mongod --setParameter ShardingTaskExecutorPoolReplicaSetMatching="automatic"
30843141

30853142
During runtime, you can also set the parameter with the
30863143
:dbcommand:`setParameter` command:
30873144

30883145
.. code-block:: javascript
30893146

3090-
db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolReplicaSetMatching: "matchBusiestNode" } )
3147+
db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolReplicaSetMatching: "automatic" } )
30913148

30923149
.. parameter:: taskExecutorPoolSize
30933150

source/release-notes/5.0.txt

+11
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,17 @@ shell method) include additional information about the status of ongoing
152152
resharding operations for the resharding coordinator and the
153153
donor and recipient shards.
154154

155+
``mongos`` / ``mongod`` Connection Pool
156+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
157+
158+
Starting in MongoDB 5.0 (also available starting in 4.4.5 and 4.2.13),
159+
MongoDB adds the parameter option ``"automatic"`` as the new default for
160+
the :parameter:`ShardingTaskExecutorPoolReplicaSetMatching`. When set
161+
for a :binary:`~bin.mongos`, the instance follows the behavior specified
162+
for the ``"matchPrimaryNode"`` option. When set for a
163+
:binary:`~bin.mongod`, the instance follows the behavior specified for
164+
the ``"disabled"`` option.
165+
155166
.. _5.0-rel-notes-security:
156167

157168
Security

0 commit comments

Comments
 (0)