Skip to content

Commit 2d8847b

Browse files
npentreljeff-allen-mongo
authored andcommitted
DOCS-14167 ReplicaSetMatching default to disabled
1 parent 966c11d commit 2d8847b

File tree

2 files changed

+118
-30
lines changed

2 files changed

+118
-30
lines changed

source/reference/command/connPoolStats.txt

Lines changed: 33 additions & 1 deletion
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:: 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

Lines changed: 85 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,46 +2290,96 @@ Sharding Parameters
22902290
.. parameter:: ShardingTaskExecutorPoolReplicaSetMatching
22912291

22922292
.. versionadded:: 4.2
2293+
.. versionchanged:: 4.2.13
22932294

22942295
Type: string
22952296

2296-
Default: "matchPrimaryNode"
2297+
Default: "automatic"
22972298

22982299
|both|
2299-
2300-
The policy that determines the minimum size limit of the
2301-
:binary:`~bin.mongos` instance's connection pools to the sharded
2302-
cluster's replica set secondaries.
2300+
2301+
On a :binary:`~bin.mongos` instance, this parameter sets the policy
2302+
that determines the minimum size limit of its connection pools to
2303+
nodes within replica sets.
2304+
2305+
On a :binary:`~bin.mongod` instance, this parameter sets the policy
2306+
that determines the minimum size limit of its connection pools to
2307+
nodes within *other* replica sets.
2308+
2309+
Note that this parameter only manages connections for operations that
2310+
are directly related to user requests and CRUD operations.
23032311

23042312
Available values are:
2305-
2313+
23062314
.. list-table::
23072315
:header-rows: 1
23082316
:widths: 15 85
2309-
2317+
23102318
* - Matching Policy
23112319
- Description
23122320

2313-
* - ``"matchPrimaryNode"`` (Default)
2314-
2315-
- For each replica set in the sharded cluster (i.e. shard
2316-
replica set and config servers), the minimum size limit of
2317-
the :binary:`~bin.mongos` instance's connection pool to each
2318-
secondary of that replica set is equal to the size of its
2319-
connection pool to the primary.
2321+
* - ``"automatic"`` (Default)
2322+
2323+
- Starting in 4.2.13, ``"automatic"`` is the
2324+
new default value.
2325+
2326+
When set for a :binary:`~bin.mongos`, the instance follows the
2327+
behavior specified for the ``"matchPrimaryNode"`` option.
23202328

2321-
In case of primary stepdown, ``matchPrimaryNode`` ensures
2329+
When set for a :binary:`~bin.mongod`, the instance follows the
2330+
behavior specified for the ``"disabled"`` option.
2331+
2332+
.. note::
2333+
2334+
If the
2335+
:parameter:`ShardingTaskExecutorPoolReplicaSetMatching` is
2336+
set to ``"automatic"``, the
2337+
:data:`~connPoolStats.replicaSetMatchingStrategy` still
2338+
describes the actual policy being used, not
2339+
``"automatic"``. To find the value of the
2340+
:parameter:`ShardingTaskExecutorPoolReplicaSetMatching`,
2341+
use :dbcommand:`getParameter` which returns the value of
2342+
the server parameter.
2343+
2344+
* - ``"matchPrimaryNode"``
2345+
2346+
- When set for a :binary:`~bin.mongos`, the minimum size limit
2347+
of the instance's connection pool to each secondary of a
2348+
replica set in the sharded cluster (specifically, shard
2349+
replica set and config servers) is equal to the size of its
2350+
connection pool to that replica set's primary.
2351+
2352+
When set for a :binary:`~bin.mongod`, the minimum size limit
2353+
of the instance's connection pool to each secondary of
2354+
another replica set in the sharded cluster (specifically,
2355+
shard replica set and config servers) is equal to the size of
2356+
its connection pool to that replica set's primary.
2357+
2358+
.. warning::
2359+
2360+
If multiple shard servers in your topology can experience a
2361+
rapid influx of cross-shard operations, do not set this
2362+
option on your :binary:`~bin.mongod` instances.
2363+
2364+
In case of a primary stepdown, ``matchPrimaryNode`` ensures
23222365
that any secondary that becomes the primary can handle the
23232366
current level of primary reads and writes.
23242367

23252368
* - ``"matchBusiestNode"``
23262369

2327-
- For each replica set in the sharded cluster (i.e. shard
2328-
replica set and config servers), the minimum size limit of
2329-
the :binary:`~bin.mongos` instance's connection pool to each
2330-
member of that replica set is equal to the largest among
2331-
the active connections counts to the primary and each
2332-
secondary members.
2370+
- When set for a :binary:`~bin.mongos`, the instance's minimum
2371+
size limit of the connection pool to each member of a replica
2372+
set in the sharded cluster (specifically, shard replica set
2373+
and config servers) is equal to the largest among the active
2374+
connection counts to the primary and each secondary member of
2375+
that replica set.
2376+
2377+
When set for a :binary:`~bin.mongod`, the instance's minimum
2378+
size limit of the connection pool to each member of another
2379+
replica set in the sharded cluster (specifically, shard
2380+
replica set and config servers) is equal to the largest among
2381+
the active connection counts to the primary and each
2382+
secondary member of that replica set.
23332383

23342384
With ``"matchBusiestNode"``, :binary:`~bin.mongos` maintains
23352385
enough connections to each secondary to handle the current
@@ -2339,26 +2389,32 @@ Sharding Parameters
23392389

23402390
* - ``"disabled"``
23412391

2342-
- For each replica set in the sharded cluster (i.e. shard
2343-
replica set and config servers), the minimum number of
2344-
connections in the :binary:`~bin.mongos` instance's
2345-
connection pool to each secondary is equal to the
2346-
:parameter:`ShardingTaskExecutorPoolMinSize`.
2392+
- When set for a :binary:`~bin.mongos`, the instance's minimum
2393+
number of connections in the instance's connection pool to
2394+
each node of a replica set in the sharded clusterv
2395+
(specifically, shard replica set and config servers) is equal
2396+
to the :parameter:`ShardingTaskExecutorPoolMinSize`.
2397+
2398+
When set for a :binary:`~bin.mongod`, the instance's minimum
2399+
number of connections in the instance's connection pool to
2400+
each node of another replica set in the sharded cluster
2401+
(specifically, shard replica set and config servers) is equal
2402+
to the :parameter:`ShardingTaskExecutorPoolMinSize`.
23472403

23482404
The following example sets the
23492405
:parameter:`ShardingTaskExecutorPoolReplicaSetMatching` to
2350-
``"matchBusiestNode"`` during startup:
2406+
``"automatic"`` during startup:
23512407

23522408
.. code-block:: sh
23532409

2354-
mongod --setParameter ShardingTaskExecutorPoolReplicaSetMatching="matchBusiestNode"
2410+
mongod --setParameter ShardingTaskExecutorPoolReplicaSetMatching="automatic"
23552411

23562412
During runtime, you can also set the parameter with the
23572413
:dbcommand:`setParameter` command:
23582414

23592415
.. code-block:: javascript
23602416

2361-
db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolReplicaSetMatching: "matchBusiestNode" } )
2417+
db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolReplicaSetMatching: "automatic" } )
23622418

23632419
.. parameter:: taskExecutorPoolSize
23642420

0 commit comments

Comments
 (0)