diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2018-12-21 13:15:40 -0500 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2019-01-22 09:34:12 -0500 |
commit | 83054ed75b67a040833c5f1855245ae65ff7a678 (patch) | |
tree | da8939845ad7d108a871c7d7b0da2cdbd0c1b9c4 | |
parent | dbcfdd8a27453e2ff552bcaa6679aac1cbc1d428 (diff) | |
download | mongo-83054ed75b67a040833c5f1855245ae65ff7a678.tar.gz |
SERVER-38740 Remove wait for drop to have pending X lock in abort_transaction_thread_does_not_block_on_locks.js
(cherry picked from commit 71f49041edda00fb1ebf224d53a8bf61726f5ac4)
-rw-r--r-- | jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js b/jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js index 79e1c1f681b..297f0bbe902 100644 --- a/jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js +++ b/jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js @@ -4,11 +4,6 @@ // require taking further locks that would queue up behind the drop cmd's database exclusive lock // request. // -// Specifically testing that transaction cursor cleanup, which takes intent locks after aborting a -// transaction, does not block the transaction aborter thread when another active transaction still -// holds intent locks and there is a exclusive lock request already queued up. The aborter thread -// should just abandon the cursor cleanup and continue: best-effort. -// // @tags: [uses_transactions] (function() { "use strict"; @@ -80,26 +75,10 @@ assert(cursorRes2.hasOwnProperty("cursor"), tojson(cursorRes2)); assert.neq(0, cursorRes2.cursor.id, tojson(cursorRes2)); - // Start the drop. - - jsTest.log("Starting a drop operation, which will block until both transactions finish"); - let awaitDrop = startParallelShell(function() { - db.getSiblingDB("test")["abort_transaction_thread_does_not_block_on_locks"].drop( - {writeConcern: {w: "majority"}}); - }); - - assert.soon(function() { - // Wait for the drop to have a pending MODE_X lock on the database, which will block - // MODE_IS lock requests behind it. - return testDB.runCommand({find: collName, maxTimeMS: 100}).code === - ErrorCodes.MaxTimeMSExpired; - }); - - // Should take 'transactionLifeTime' plus the period of the transaction aborter thread, - // which is transactionLifeTime / 2 (or a max of 1 minute). - jsTest.log("Waiting for transactions to expire and drop to finish. Should take " + - transactionLifeTime * 1.5 + " seconds or less."); - awaitDrop(); + jsTest.log("Perform a drop. This will block until both transactions finish. The " + + "transactions should expire in " + transactionLifeTime * 1.5 + + " seconds or less."); + assert.commandWorked(testDB.runCommand({drop: collName, writeConcern: {w: "majority"}})); // Verify and cleanup. |