From ca29cc4f4f9b7de04dc507c0428da898cbd1c9cd Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Mon, 27 Oct 2014 12:22:10 -0400 Subject: SERVER-15541 Don't do anything with MMAPV1Flush unless IsForMMAPV1 --- src/mongo/db/concurrency/lock_state.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mongo/db') diff --git a/src/mongo/db/concurrency/lock_state.cpp b/src/mongo/db/concurrency/lock_state.cpp index 7168b2529a9..a556b853b9c 100644 --- a/src/mongo/db/concurrency/lock_state.cpp +++ b/src/mongo/db/concurrency/lock_state.cpp @@ -577,7 +577,9 @@ namespace mongo { // The global lock must have been acquired just once stateOut->globalMode = globalRequest->mode; invariant(unlock(resourceIdGlobal)); - invariant(unlock(resourceIdMMAPV1Flush)); + if (IsForMMAPV1) { + invariant(unlock(resourceIdMMAPV1Flush)); + } // Next, the non-global locks. for (LockRequestsMap::Iterator it = _requests.begin(); !it.finished(); it.next()) { @@ -608,7 +610,7 @@ namespace mongo { // We shouldn't be saving and restoring lock state from inside a WriteUnitOfWork. invariant(!inAWriteUnitOfWork()); - lockGlobal(state.globalMode); + lockGlobal(state.globalMode); // also handles MMAPV1Flush std::vector::const_iterator it = state.locks.begin(); for (; it != state.locks.end(); it++) { @@ -658,6 +660,7 @@ namespace mongo { template void LockerImpl::_yieldFlushLockForMMAPV1() { + invariant(IsForMMAPV1); if (!inAWriteUnitOfWork()) { invariant(unlock(resourceIdMMAPV1Flush)); invariant(LOCK_OK == -- cgit v1.2.1