Retryable Transactions
Parent: MongoDB Transactions · Published reference · snapshot 2026-10-15
↓ Facts as markdownall context files
Depth-first rabbithole dossier for Retryable Transactions; source-anchored research pack.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
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]
- [low] Writes with Write Concern 0 are not retryable. Sources: https://www.mongodb.com/docs/manual/core/retryable-writes.md [source]
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]
- [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]
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]
- [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]
- [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]
- [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]
- [low] Retryable writes fail if failover takes longer than the serverSelectionTimeoutMS timeout. Sources: https://www.mongodb.com/docs/manual/core/retryable-writes.md [source]
- [low] Writes to the local database fail unless retryable writes are disabled. Sources: https://www.mongodb.com/docs/manual/core/retryable-writes.md [source]
- [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]
- [low] UnknownTransactionCommitResult is raised if the commit operation encounters an error. Sources: https://www.mongodb.com/docs/drivers/node/current/crud/transactions.md [source]
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]
- [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]
- [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]
- [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]
- [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]
- [low] MongoDB transactions ignore the retryWrites setting and retry regardless. Sources: https://jepsen.io/analyses/mongodb-4.2.6 [source]
- [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]
- [low] Inside a retryable internal transaction, only the statements with stmtIds are retryable. Sources: https://jira.mongodb.org/browse/SERVER-99784 [source]
- [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]
Related concepts
- Transactions — is a part of Retryable Transactions
- Retryable — is a part of Retryable Transactions
Children
- No children recorded.