From fc0fc2d6ecda2c856796fbb2401d4da0e4601256 Mon Sep 17 00:00:00 2001 From: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> Date: Tue, 2 Mar 2021 17:06:15 +0100 Subject: [PATCH] DOCS-14167 ReplicaSetMatching default to disabled --- source/reference/command/connPoolStats.txt | 34 +++++- source/reference/parameters.txt | 114 +++++++++++++++------ 2 files changed, 118 insertions(+), 30 deletions(-) diff --git a/source/reference/command/connPoolStats.txt b/source/reference/command/connPoolStats.txt index 29fecb9fbdd..a53a326cf32 100644 --- a/source/reference/command/connPoolStats.txt +++ b/source/reference/command/connPoolStats.txt @@ -86,6 +86,7 @@ The command returns the output of the following form: "totalAvailable" : , "totalCreated" : , "totalRefreshing" : , + "replicaSetMatchingStrategy" : , "pools" : { "NetworkInterfaceTL-TaskExecutorPool-0" : { "poolInUse" : , @@ -300,7 +301,6 @@ The command returns the output of the following form: "signature" : }, "operationTime" : - } Output @@ -331,6 +331,38 @@ Output members of the :term:`sharded cluster` or :term:`replica set` that are currently being refreshed. +.. data:: connPoolStats.replicaSetMatchingStrategy + + .. versionadded::4.4.5 (*Also available starting in 4.2.13*) + + On a :binary:`~bin.mongos` instance, this value reports the policy + used by the instance to determine the minimum size limit of its + connection pools to nodes within replica sets. + + On a :binary:`~bin.mongod` instance, this value reports the policy + used by the instance to determine the minimum size limit of its + connection pools to nodes within *other* replica sets. + + The policy for :binary:`~bin.mongos` and :binary:`~bin.mongod` can be + set with the :parameter:`ShardingTaskExecutorPoolReplicaSetMatching` + parameter. + + .. note:: + + If the :parameter:`ShardingTaskExecutorPoolReplicaSetMatching` is + set to ``"automatic"``, the + :data:`~connPoolStats.replicaSetMatchingStrategy` still describes + the actual policy being used, not ``"automatic"``. To find the + value of the + :parameter:`ShardingTaskExecutorPoolReplicaSetMatching`, use + :dbcommand:`getParameter` which returns the value of the server + parameter: + + .. code-block:: javascript + + db.adminCommand( { getParameter : 1, "ShardingTaskExecutorPoolReplicaSetMatching" : 1 } ) + + .. data:: connPoolStats.numClientConnection Reports the number of active and stored outgoing **synchronous** diff --git a/source/reference/parameters.txt b/source/reference/parameters.txt index a9feb74c35c..bb9a85a00d2 100644 --- a/source/reference/parameters.txt +++ b/source/reference/parameters.txt @@ -2900,46 +2900,96 @@ Sharding Parameters .. parameter:: ShardingTaskExecutorPoolReplicaSetMatching .. versionadded:: 4.2 + .. versionchanged:: 4.4.5 (*Also starting in 4.2.13*) Type: string - Default: "matchPrimaryNode" + Default: "automatic" |both| - - The policy that determines the minimum size limit of the - :binary:`~bin.mongos` instance's connection pools to the sharded - cluster's replica set secondaries. + + On a :binary:`~bin.mongos` instance, this parameter sets the policy + that determines the minimum size limit of its connection pools to + nodes within replica sets. + + On a :binary:`~bin.mongod` instance, this parameter sets the policy + that determines the minimum size limit of its connection pools to + nodes within *other* replica sets. + + Note that this parameter only manages connections for operations that + are directly related to user requests and CRUD operations. Available values are: - + .. list-table:: :header-rows: 1 :widths: 15 85 - + * - Matching Policy - Description - * - ``"matchPrimaryNode"`` (Default) - - - For each replica set in the sharded cluster (i.e. shard - replica set and config servers), the minimum size limit of - the :binary:`~bin.mongos` instance's connection pool to each - secondary of that replica set is equal to the size of its - connection pool to the primary. + * - ``"automatic"`` (Default) + + - Starting in 4.4.5 (and 4.2.13), ``"automatic"`` is the + new default value. + + When set for a :binary:`~bin.mongos`, the instance follows the + behavior specified for the ``"matchPrimaryNode"`` option. - In case of primary stepdown, ``matchPrimaryNode`` ensures + When set for a :binary:`~bin.mongod`, the instance follows the + behavior specified for the ``"disabled"`` option. + + .. note:: + + If the + :parameter:`ShardingTaskExecutorPoolReplicaSetMatching` is + set to ``"automatic"``, the + :data:`~connPoolStats.replicaSetMatchingStrategy` still + describes the actual policy being used, not + ``"automatic"``. To find the value of the + :parameter:`ShardingTaskExecutorPoolReplicaSetMatching`, + use :dbcommand:`getParameter` which returns the value of + the server parameter. + + * - ``"matchPrimaryNode"`` + + - When set for a :binary:`~bin.mongos`, the minimum size limit + of the instance's connection pool to each secondary of a + replica set in the sharded cluster (specifically, shard + replica set and config servers) is equal to the size of its + connection pool to that replica set's primary. + + When set for a :binary:`~bin.mongod`, the minimum size limit + of the instance's connection pool to each secondary of + another replica set in the sharded cluster (specifically, + shard replica set and config servers) is equal to the size of + its connection pool to that replica set's primary. + + .. warning:: + + If multiple shard servers in your topology can experience a + rapid influx of cross-shard operations, do not set this + option on your :binary:`~bin.mongod` instances. + + In case of a primary stepdown, ``matchPrimaryNode`` ensures that any secondary that becomes the primary can handle the current level of primary reads and writes. * - ``"matchBusiestNode"`` - - For each replica set in the sharded cluster (i.e. shard - replica set and config servers), the minimum size limit of - the :binary:`~bin.mongos` instance's connection pool to each - member of that replica set is equal to the largest among - the active connections counts to the primary and each - secondary members. + - When set for a :binary:`~bin.mongos`, the instance's minimum + size limit of the connection pool to each member of a replica + set in the sharded cluster (specifically, shard replica set + and config servers) is equal to the largest among the active + connection counts to the primary and each secondary member of + that replica set. + + When set for a :binary:`~bin.mongod`, the instance's minimum + size limit of the connection pool to each member of another + replica set in the sharded cluster (specifically, shard + replica set and config servers) is equal to the largest among + the active connection counts to the primary and each + secondary member of that replica set. With ``"matchBusiestNode"``, :binary:`~bin.mongos` maintains enough connections to each secondary to handle the current @@ -2949,26 +2999,32 @@ Sharding Parameters * - ``"disabled"`` - - For each replica set in the sharded cluster (i.e. shard - replica set and config servers), the minimum number of - connections in the :binary:`~bin.mongos` instance's - connection pool to each secondary is equal to the - :parameter:`ShardingTaskExecutorPoolMinSize`. + - When set for a :binary:`~bin.mongos`, the instance's minimum + number of connections in the instance's connection pool to + each node of a replica set in the sharded clusterv + (specifically, shard replica set and config servers) is equal + to the :parameter:`ShardingTaskExecutorPoolMinSize`. + + When set for a :binary:`~bin.mongod`, the instance's minimum + number of connections in the instance's connection pool to + each node of another replica set in the sharded cluster + (specifically, shard replica set and config servers) is equal + to the :parameter:`ShardingTaskExecutorPoolMinSize`. The following example sets the :parameter:`ShardingTaskExecutorPoolReplicaSetMatching` to - ``"matchBusiestNode"`` during startup: + ``"automatic"`` during startup: .. code-block:: sh - mongod --setParameter ShardingTaskExecutorPoolReplicaSetMatching="matchBusiestNode" + mongod --setParameter ShardingTaskExecutorPoolReplicaSetMatching="automatic" During runtime, you can also set the parameter with the :dbcommand:`setParameter` command: .. code-block:: javascript - db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolReplicaSetMatching: "matchBusiestNode" } ) + db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolReplicaSetMatching: "automatic" } ) .. parameter:: taskExecutorPoolSize