Added a new server parameter transactionLifetimeLimitSeconds. Settable on startup and via setParameter, retrievable via getParameter. Defaults to 60 seconds. Minimum acceptable value is 1 second. Only useful on storage engines that support transactions.
Dictates the lifetime given to each transaction, after which a periodic (runs every transactionLifetimeLimitSeconds/2 seconds, or at most once per second and at least once per minute) background thread will find and abort the transaction.
Each transaction maintains a snapshot of the storage engine data at a point in time, requiring the storage engine to maintain that history all the way back to that point in time, which has the potential to fill up its cache and immobilize the system. Users may also forget to commit transactions, in which case they should be cleaned up eventually. Transactions therefore must expire to preempt storage cache pressure immobilizing the system.
- Parameter page
- added a Production Consideration section
- runtime limit section
- actively abort when abandoning transactions
- Release notes
From the design,
The "oldest" open transaction in WiredTiger will pin write history in cache until it finishes. Here, "oldest" means the read timestamp is the earliest of any open transaction on the system. Any write history with a timestamp equal to or newer than this read timestamp must stay pinned in cache, in order to serve the open transaction. We need a way to prevent these transactions from staying open too long, in order to prevent cache pressure from becoming too extreme."
Adding a transactionLifetimeLimitSeconds server parameter, which can be set at startup and via setParameter. Transaction will now expire, per the server parameter, and be asynchronously periodically cleaned up.