<!-- llms-explorer concept facts · https://llms-explorer.com/tree/retryable-transactions/ · pack 2026-10-15 · ~2046 tokens -->

# Retryable Transactions

> Depth-first rabbithole dossier for Retryable Transactions; source-anchored research pack.

Parent: [MongoDB Transactions](https://llms-explorer.com/tree/mongodb-transactions/) · 4 facets · 21 facts · page: https://llms-explorer.com/tree/retryable-transactions/

## Definitions

- [medium] Individual write operations inside a transaction are not retryable, regardless of the value of retryWrites. Sources: https://www.mongodb.com/docs/manual/core/transactions-in-applications.md, https://www.mongodb.com/docs/manual/core/retryable-writes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] Writes with Write Concern 0 are not retryable. Sources: https://www.mongodb.com/docs/manual/core/retryable-writes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`

## How it works

- [low] The Convenient Transaction API includes a function that retries the entire transaction when the driver encounters a TransientTransactionError. Sources: https://www.mongodb.com/docs/drivers/node/current/crud/transactions.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] The Convenient Transaction API includes a function that retries the commit operation when the driver encounters an UnknownTransactionCommitResult. Sources: https://www.mongodb.com/docs/drivers/node/current/crud/transactions.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`

## Problems, failure modes and limitations

- [medium] Starting in MongoDB 6.2, the server does not retry the transaction if it receives a TransactionTooLargeForCache error. (verified as of 2026-10-14) Sources: https://www.mongodb.com/docs/manual/core/transactions.md, https://www.mongodb.com/docs/manual/core/transactions-in-applications.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] Starting in MongoDB 8.1, if an upsert operation runs in a multidocument transaction, the upsert does not retry when it encounters a duplicate key error. (verified as of 2026-10-14) Sources: https://www.mongodb.com/docs/manual/core/transactions.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] Starting in MongoDB 6.1, if both the first and second attempt of a retryable write fail without a single write being performed, MongoDB returns an error with the NoWritesPerformed label. (verified as of 2026-10-14) Sources: https://www.mongodb.com/docs/manual/core/retryable-writes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] In previous versions of MongoDB, an error is returned when both the first and second attempts of a retryable write fail, but there is no distinction made to indicate that no writes were performed. (verified as of 2026-10-14) Sources: https://www.mongodb.com/docs/manual/core/retryable-writes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] Retryable writes fail if failover takes longer than the serverSelectionTimeoutMS timeout. Sources: https://www.mongodb.com/docs/manual/core/retryable-writes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#troubleshooting`
- [low] Writes to the local database fail unless retryable writes are disabled. Sources: https://www.mongodb.com/docs/manual/core/retryable-writes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#troubleshooting`
- [low] TransientTransactionError is raised if a write operation encounters an error before the driver commits the transaction. Sources: https://www.mongodb.com/docs/drivers/node/current/crud/transactions.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#troubleshooting`
- [low] UnknownTransactionCommitResult is raised if the commit operation encounters an error. Sources: https://www.mongodb.com/docs/drivers/node/current/crud/transactions.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#troubleshooting`

## Facts and statements

- [low] Retryable writes require MongoDB 3.6+ and featureCompatibilityVersion 3.6+ on all nodes. Transactions themselves require featureCompatibilityVersion 4.0 for a replica set and 4.2 for a sharded cluster. (verified as of 2026-10-14) Sources: https://www.mongodb.com/docs/manual/core/retryable-writes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] The callback API incorporates retry logic for certain errors, trying to rerun the transaction after a TransientTransactionError or UnknownTransactionCommitResult. Sources: https://www.mongodb.com/docs/manual/core/transactions.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [high] Commit operations are retryable write operations, and MongoDB drivers retry the commit regardless of the value of retryWrites. Sources: https://www.mongodb.com/docs/manual/core/transactions-in-applications.md, https://www.mongodb.com/blog/post/performance-best-practices-transactions-and-read--write-concerns — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] Drivers compatible with MongoDB 4.2 and higher enable Retryable Writes by default. (verified as of 2026-10-14) Sources: https://www.mongodb.com/docs/manual/core/retryable-writes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] The Convenient Transaction API incorporates retry logic for TransientTransactionError and UnknownTransactionCommitResult, automatically retrying the transaction until there is a successful commit. Sources: https://www.mongodb.com/docs/drivers/node/current/crud/transactions.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] MongoDB transactions ignore the retryWrites setting and retry regardless. Sources: https://jepsen.io/analyses/mongodb-4.2.6 — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] MongoDB transactions automatically retry on transient errors such as temporary network interruptions, and this retry is transparent to the client. Sources: https://help.aliyun.com/en/mongodb/use-cases/transactions-and-read-write-concern — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] Inside a retryable internal transaction, only the statements with stmtIds are retryable. Sources: https://jira.mongodb.org/browse/SERVER-99784 — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`
- [low] Applications should take measures to handle errors during transaction commits and incorporate retry logic for transactions. Sources: https://www.mongodb.com/community/forums/t/issues-mongodb-transactions-pessimistic-locking/118377 — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/retryable-transactions-39e78f4d93/rabbithole-synthesis.md#core`

## Related concepts

- Transactions — is a part of Retryable Transactions
- Retryable — is a part of Retryable Transactions
