summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/apply_ops.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-11-20 14:25:35 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-12-05 16:02:53 -0500
commitdb123c1f4f7f971d4410f735b78d0fd332984477 (patch)
treecf093e15edfe72ffc2d9e680d5a36b58ad254355 /src/mongo/db/commands/apply_ops.cpp
parentac13fc6ab3ea3a3800ac494596acf2eb40beec72 (diff)
downloadmongo-db123c1f4f7f971d4410f735b78d0fd332984477.tar.gz
SERVER-16431 Implement TempRelease in terms of save/restore lock state
Allows us to get rid of the scoped lock chaining and pass on the recursivity tracking to Locker::saveLockState.
Diffstat (limited to 'src/mongo/db/commands/apply_ops.cpp')
-rw-r--r--src/mongo/db/commands/apply_ops.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/commands/apply_ops.cpp b/src/mongo/db/commands/apply_ops.cpp
index c7aa7de3888..dc8c4bd601c 100644
--- a/src/mongo/db/commands/apply_ops.cpp
+++ b/src/mongo/db/commands/apply_ops.cpp
@@ -140,7 +140,12 @@ namespace mongo {
// TODO figure out what to do about this.
ScopedTransaction transaction(txn, MODE_IX);
Lock::DBLock lk(txn->lockState(), nsToDatabaseSubstring(ns), MODE_X);
- invariant(txn->lockState()->isRecursive());
+
+ // Ensures that yielding will not happen (see the comment above).
+ DEV {
+ Locker::LockSnapshot lockSnapshot;
+ invariant(!txn->lockState()->saveLockStateAndUnlock(&lockSnapshot));
+ };
Client::Context ctx(txn, ns);
bool failed = repl::applyOperation_inlock(txn,