...
It is possible for the transaction timeout periodic task to block on aborting a transaction, while attempting to acquire a database lock. The following is one scenario where this can happen: Two transactions are opened for a given collection A collection client cursor is opened for each and MODE_IX database and collection locks are acquired A drop database command is executed which requests a MODE_X database lock. This request is blocked on both transactions MODE_IX lock After one minute, the transaction timeout periodic task runs: An attempt is made to abort the first transaction. Transaction resources (locks and WiredTiger transaction) are freed. killCursors is called to kill the client cursor. The cursor kill attempt requires a MODE_IS lock which is blocked by the MODE_X request. The MODE_X request is still blocked by the second transactions MODE_IX lock. At this point unless transaction 2 is committed or aborted by the user, it will continue to block the database drop. The transaction timeout periodic runner will not timeout the second transaction as it is blocked on killing cursors for the first transaction. Additionally the MODE_X lock will block any further user operations on the database. Performing transaction timeout with a 0-second lock acquisition timeout would address the above scenario. On failing to kill cursors for transaction 1 it would proceed with killing transaction 2. This would unblock the database drop and allow other operations to run.
xgen-internal-githook commented on Tue, 15 May 2018 20:01:43 +0000: Author: {'email': 'dianna.hohensee@10gen.com', 'username': 'DiannaHohensee', 'name': 'Dianna Hohensee'} Message: SERVER-34800 The transaction aborter thread uses 0-second lock acquisition timeout for all lock requests Branch: master https://github.com/mongodb/mongo/commit/9df77c72447bad5fab1d2b40feda83749b3767db james.wahlin@10gen.com commented on Wed, 2 May 2018 18:24:55 +0000: We should also consider running the session timeout mechanism with a 0-second lock acquisition timeout as well.
Click on a version to see all relevant bugs
MongoDB Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.