@@ -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