Skip to content

Commit 9b14ae5

Browse files
author
Dave Cuthbert
authored
DOCS-15168-set-retry-parameters-v6.1 (#1681)
* Review feedback * DOCS-15168 set retry parameters * Sync update from another PR
1 parent c0208e7 commit 9b14ae5

File tree

3 files changed

+100
-2
lines changed

3 files changed

+100
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
In rare circumstances, a write can fail due to cache pressure. When
2+
this happens MongoDB issues a ``TemporarilyUnavailable`` error and
3+
increments the ``temporarilyUnavailableErrors`` counter in two places:
4+
the slow query log and the :ref:`Full Time Diagnostic Data Collection
5+
(FTDC) <ftdc-stub>`.
6+
7+
Individual operations within multi-document transactions never return
8+
``TemporarilyUnavailable`` errors.
9+
10+
Adjust the write retry properties by modifying the
11+
:parameter:`temporarilyUnavailableBackoffBaseMs` and
12+
:parameter:`temporarilyUnavailableMaxRetries` parameters.
13+

source/reference/parameters.txt

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2601,11 +2601,11 @@ If you attempt to update ``disableSplitHorizonIPCheck`` at runtime,
26012601
parallel. Values can range from 1 to 256 inclusive. However, the
26022602
maximum number of threads used is capped at twice the number of
26032603
available cores.
2604-
2604+
26052605
You can only set :parameter:`replWriterThreadCount` at startup and
26062606
cannot change this setting with the :dbcommand:`setParameter`
26072607
command.
2608-
2608+
26092609
.. seealso::
26102610

26112611
:parameter:`replWriterMinThreadCount`
@@ -4376,6 +4376,76 @@ Storage Parameters
43764376
- :parameter:`journalCommitInterval`
43774377
- :setting:`storage.syncPeriodSecs`
43784378

4379+
.. parameter:: temporarilyUnavailableBackoffBaseMs
4380+
4381+
|mongod-only|
4382+
4383+
Specifies the initial delay before retying a write operation that was
4384+
rolled back due to cache pressure.
4385+
4386+
.. include:: /includes/reference/fact-parameters-cache-pressure.rst
4387+
4388+
The parameter accepts:
4389+
4390+
.. list-table::
4391+
:header-rows: 1
4392+
:widths: 20 80
4393+
4394+
* - Value
4395+
- Description
4396+
4397+
* - ``integer >= 0``
4398+
4399+
- Defaults to 1 second. The initial delay between retries. The
4400+
value increases with each retry to a maximum of 55 seconds. A
4401+
larger value increases the chance that the cache pressure
4402+
will be reduced before the next retry.
4403+
4404+
To configure number of retires, use
4405+
:parameter:`temporarilyUnavailableMaxRetries`.
4406+
4407+
To set a new value, use :method:`db.adminCommand()`:
4408+
4409+
.. code-block:: javascript
4410+
4411+
db.adminCommand( { setParameter: 1, temporarilyUnavailableBackoffBaseMs: 3 } )
4412+
4413+
*Available starting in MongoDB 6.1.0*
4414+
4415+
.. parameter:: temporarilyUnavailableMaxRetries
4416+
4417+
|mongod-only|
4418+
4419+
Specifies the maximum number of retries when a write operation is
4420+
rolled back due to cache pressure.
4421+
4422+
.. include:: /includes/reference/fact-parameters-cache-pressure.rst
4423+
4424+
The parameter accepts:
4425+
4426+
.. list-table::
4427+
:header-rows: 1
4428+
:widths: 20 80
4429+
4430+
* - Value
4431+
- Description
4432+
4433+
* - ``integer >= 0``
4434+
4435+
- Defaults to 10. The maximum number of retries.
4436+
4437+
There is an increasing delay between retries. To configure
4438+
the backoff time, use
4439+
:parameter:`temporarilyUnavailableBackoffBaseMs`.
4440+
4441+
To set a new value, use :method:`db.adminCommand()`:
4442+
4443+
.. code-block:: javascript
4444+
4445+
db.adminCommand( { setParameter: 1, temporarilyUnavailableMaxRetries: 5 } )
4446+
4447+
*Available starting in MongoDB 6.1.0*
4448+
43794449
WiredTiger Parameters
43804450
~~~~~~~~~~~~~~~~~~~~~
43814451

source/release-notes/6.1.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ Starting in MongoDB 6.1, the :dbcommand:`serverStatus` command and the
9999

100100
- :serverstatus:`connections.rejected`
101101

102+
Storage Engine
103+
~~~~~~~~~~~~~~
104+
105+
.. include:: /includes/reference/fact-parameters-cache-pressure.rst
106+
107+
Server Parameters
108+
-----------------
109+
110+
Starting in MongoDB 6.1, MongoDB adds the following new parameters:
111+
112+
- :parameter:`temporarilyUnavailableBackoffBaseMs` adjusts the time
113+
between retries after a write failure.
114+
- :parameter:`temporarilyUnavailableMaxRetries` limits the number of
115+
retries after a write failure.
116+
102117
Report an Issue
103118
---------------
104119

0 commit comments

Comments
 (0)