Skip to content

Commit 89f680f

Browse files
authored
DOCS-16135 transactionTooLargeForCache v6.0 Docs (#6499) (#6533)
* DOCS-16135 transactionTooLargeForCache v6.0 Docs (#6499) * DOCS-16135 transactionTooLargeForCache 6.0 Docs * * * build errors 1/2
1 parent fa6a9fd commit 89f680f

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

source/core/transactions-in-applications.txt

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ The callback API incorporates logic:
4646
:ref:`transient-transaction-error`.
4747

4848
- To retry the commit operation if the commit encounters an
49-
:ref:`unknown-transaction-commit-result`.
49+
:ref:`unknown-transaction-commit-result` error.
50+
51+
Starting in MongoDB 5.0.16, the server does not retry the transaction if
52+
it receives a :ref:`transactionTooLargeForCache-error` error.
5053

5154
Example
5255
~~~~~~~
@@ -412,6 +415,27 @@ If the commit operation encounters an error labeled
412415
``"UnknownTransactionCommitResult"``, applications should explicitly
413416
incorporate retry logic for the error.
414417

418+
.. _transactionTooLargeForCache-error:
419+
420+
``TransactionTooLargeForCache``
421+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
422+
423+
.. versionadded:: 5.0.16
424+
425+
Starting in MongoDB 5.0.16, the server does not retry the transaction if
426+
it receives a ``TransactionTooLargeForCache`` error. This error means
427+
the cache is too small and a retry is likely to fail.
428+
429+
The default value for the
430+
:parameter:`transactionTooLargeForCacheThreshold` threshold is ``0.75``.
431+
The server returns ``TransactionTooLargeForCache`` instead of retrying
432+
the transaction when the transaction uses more than 75% of the cache.
433+
434+
In earlier versions of MongoDB, the server returns
435+
``TemporarilyUnavailable`` or ``WriteConflict`` instead of
436+
``TransactionTooLargeForCache``.
437+
438+
Use the :dbcommand:`setParameter` command to modify the error threshold.
415439

416440
Driver Version Errors
417441
~~~~~~~~~~~~~~~~~~~~~

source/reference/parameters.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4567,7 +4567,36 @@ Transaction Parameters
45674567
modified for all shard replica set members.
45684568

45694569
.. include:: /includes/transactionLifetimeLimitSeconds-parameter.rst
4570+
4571+
.. parameter:: transactionTooLargeForCacheThreshold
4572+
4573+
.. versionadded:: 5.0.16
4574+
4575+
|mongod-only|
4576+
4577+
*Type*: decimal
4578+
4579+
*Default*: 0.75
4580+
4581+
The threshold value for retrying transactions that fail due to cache
4582+
pressure. The value is a percentage of the dirty cache size. The
4583+
default value, ``0.75``, means 75% of the dirty cache.
4584+
4585+
The dirty cache is limited to 20% of the total cache size. When
4586+
``transactionTooLargeForCacheThreshold`` is set to ``0.75``, the
4587+
server only retries transactions that use less than 15%
4588+
(``0.75 * 20%``) of the total storage engine cache.
45704589

4590+
The limit only applies to retries. Large transactions can use more
4591+
than ``transactionTooLargeForCacheThreshold`` percent of the dirty
4592+
cache. However, if a large transaction is rolled back due to cache
4593+
pressure, the server issues a
4594+
:ref:`transactionTooLargeForCache-error` error and does not retry the
4595+
transaction.
4596+
4597+
To disable this behavior, set
4598+
``transactionTooLargeForCacheThreshold`` to ``1.0``.
4599+
45714600
.. parameter:: maxTransactionLockRequestTimeoutMillis
45724601

45734602
|mongod-only|

0 commit comments

Comments
 (0)