summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency/deadlock_detection_test.cpp
diff options
context:
space:
mode:
authorGeert Bosch <bosch@gnat.com>2018-07-08 11:26:02 -0400
committerGeert Bosch <geert@mongodb.com>2018-07-11 10:11:00 -0400
commitc7bd92f7ded5501654989eb9b9a80bbf50d3ec3b (patch)
tree60724a273bc50960b0ed9afee6e24ad8b92e8e1b /src/mongo/db/concurrency/deadlock_detection_test.cpp
parent80c7c825a44cf99b17e81f4233445c7ab1927706 (diff)
downloadmongo-c7bd92f7ded5501654989eb9b9a80bbf50d3ec3b.tar.gz
SERVER-36011 Remove MMAPv1 lockmanager support
Diffstat (limited to 'src/mongo/db/concurrency/deadlock_detection_test.cpp')
-rw-r--r--src/mongo/db/concurrency/deadlock_detection_test.cpp54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/mongo/db/concurrency/deadlock_detection_test.cpp b/src/mongo/db/concurrency/deadlock_detection_test.cpp
index ead27261e1a..f5e64e23578 100644
--- a/src/mongo/db/concurrency/deadlock_detection_test.cpp
+++ b/src/mongo/db/concurrency/deadlock_detection_test.cpp
@@ -134,58 +134,4 @@ TEST(Deadlock, Indirect) {
locker2.unlock(resIdA);
}
-TEST(Deadlock, IndirectWithUpgrade) {
- const ResourceId resIdFlush(RESOURCE_MMAPV1_FLUSH, 1);
- const ResourceId resIdDb(RESOURCE_DATABASE, 2);
-
- LockerForTests flush(MODE_IX);
- LockerForTests reader(MODE_IS);
- LockerForTests writer(MODE_IX);
-
- // This sequence simulates the deadlock which occurs during flush
- ASSERT_EQUALS(LOCK_OK, writer.lockBegin(nullptr, resIdFlush, MODE_IX));
- ASSERT_EQUALS(LOCK_OK, writer.lockBegin(nullptr, resIdDb, MODE_X));
-
- ASSERT_EQUALS(LOCK_OK, reader.lockBegin(nullptr, resIdFlush, MODE_IS));
-
- // R -> W
- ASSERT_EQUALS(LOCK_WAITING, reader.lockBegin(nullptr, resIdDb, MODE_S));
-
- // R -> W
- // F -> W
- ASSERT_EQUALS(LOCK_WAITING, flush.lockBegin(nullptr, resIdFlush, MODE_S));
-
- // W yields its flush lock, so now f is granted in mode S
- //
- // R -> W
- writer.unlock(resIdFlush);
-
- // Flush thread upgrades S -> X in order to do the remap
- //
- // R -> W
- // F -> R
- ASSERT_EQUALS(LOCK_WAITING, flush.lockBegin(nullptr, resIdFlush, MODE_X));
-
- // W comes back from the commit and tries to re-acquire the flush lock
- //
- // R -> W
- // F -> R
- // W -> F
- ASSERT_EQUALS(LOCK_WAITING, writer.lockBegin(nullptr, resIdFlush, MODE_IX));
-
- // Run deadlock detection from the point of view of each of the involved lockers
- DeadlockDetector wfgF(*getGlobalLockManager(), &flush);
- ASSERT(wfgF.check().hasCycle());
-
- DeadlockDetector wfgR(*getGlobalLockManager(), &reader);
- ASSERT(wfgR.check().hasCycle());
-
- DeadlockDetector wfgW(*getGlobalLockManager(), &writer);
- ASSERT(wfgW.check().hasCycle());
-
- // Cleanup, so that LockerImpl doesn't complain about leaked locks
- flush.unlock(resIdFlush);
- writer.unlock(resIdFlush);
-}
-
} // namespace mongo