Skip to content

Commit 36be09d

Browse files
author
Dave
authored
DOCS-14892 BACKPORT (#691)
* DOCS-14892 BACKPORT * Remove 5.2 release notes * Remove 5.0 release notes
1 parent 9097a96 commit 36be09d

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

source/reference/parameters.txt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2833,6 +2833,57 @@ Sharding Parameters
28332833

28342834
`Live Migration Protocol <https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/README.md#the-live-migration-protocol>`__
28352835

2836+
.. parameter:: metadataRefreshInTransactionMaxWaitBehindCritSecMS
2837+
2838+
.. versionadded:: 5.2 (*Also available starting in 5.1.0, 5.0.4*)
2839+
2840+
*Type*: integer
2841+
2842+
*Default*: 500
2843+
2844+
|mongod-only|
2845+
2846+
Limits the time a shard waits for a critical section within a
2847+
transaction.
2848+
2849+
When a query accesses a shard, a :ref:`chunk migration
2850+
<migrate-chunks-sharded-cluster>` or :ref:`DDL operation
2851+
<transactions-operations-ddl>` may already hold the critical
2852+
section for the collection. If the query finds the critical
2853+
section is taken, the shard waits until the critical section has
2854+
been released. When the shard returns control to :binary:`mongos`,
2855+
:binary:`mongos` retries the query. However, if a multi-shard
2856+
transaction interacts with an operation that takes the critical
2857+
section on multiple shards, the interaction can result in a
2858+
distributed deadlock.
2859+
2860+
2861+
:parameter:`metadataRefreshInTransactionMaxWaitBehindCritSecMS`
2862+
limits the maximum time a shard waits within a transaction for the
2863+
critical section to be released.
2864+
2865+
To reduce the maximum wait time for the critical section within a
2866+
transaction, lower the the value of
2867+
:parameter:`metadataRefreshInTransactionMaxWaitBehindCritSecMS`.
2868+
2869+
.. warning::
2870+
2871+
If :parameter:`metadataRefreshInTransactionMaxWaitBehindCritSecMS`
2872+
is too low, :binary:`mongos` could use all of its retry attempts
2873+
and return an error.
2874+
2875+
You can set
2876+
:parameter:`metadataRefreshInTransactionMaxWaitBehindCritSecMS` at
2877+
startup and during runtime.
2878+
2879+
For example, to set :parameter:`metadataRefreshInTransactionMaxWaitBehindCritSecMS`
2880+
to 400 milliseconds:
2881+
2882+
.. code-block:: javascript
2883+
2884+
db.adminCommand( { setParameter: 1, metadataRefreshInTransactionMaxWaitBehindCritSecMS: 400 } )
2885+
2886+
28362887
.. parameter:: readHedgingMode
28372888

28382889
.. versionadded:: 4.4

0 commit comments

Comments
 (0)