summaryrefslogtreecommitdiff
path: root/src/mongo/db/instance.cpp
diff options
context:
space:
mode:
authorGeert Bosch <geert@mongodb.com>2014-09-30 09:56:21 -0400
committerGeert Bosch <geert@mongodb.com>2014-09-30 22:02:04 -0400
commitda599844c97ef6d290c03e073a9bafe41c1a914e (patch)
tree4b942aba73479a433b371db0dd713b3f0bd375f8 /src/mongo/db/instance.cpp
parent068b1d23bb513bfc819de61514262a12cb75bcbb (diff)
downloadmongo-da599844c97ef6d290c03e073a9bafe41c1a914e.tar.gz
SERVER-14668: Replace uses of DBWrite lock with DBLock
This reverts commit 8e83e72512fcb8eb8f06987927766c0b77cea23e. This reinstates commit ae333bc94a7d89d3220dcae9579fcaf68aa2e290 and commit 962f959a09b63aa0482d7e0c9bad89363d1e1194, and fixes three cases where the wrong database name was locked.
Diffstat (limited to 'src/mongo/db/instance.cpp')
-rw-r--r--src/mongo/db/instance.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
index dd37aaf5b1e..2d8b189edc3 100644
--- a/src/mongo/db/instance.cpp
+++ b/src/mongo/db/instance.cpp
@@ -621,7 +621,7 @@ namespace mongo {
UpdateExecutor executor(&request, &op.debug());
uassertStatusOK(executor.prepare());
- Lock::DBWrite lk(txn->lockState(), ns.ns());
+ Lock::DBLock lk(txn->lockState(), ns.db(), newlm::MODE_X);
Client::Context ctx(txn, ns );
UpdateResult res = executor.execute(ctx.db());
@@ -655,7 +655,7 @@ namespace mongo {
DeleteExecutor executor(&request);
uassertStatusOK(executor.prepare());
- Lock::DBWrite lk(txn->lockState(), ns.ns());
+ Lock::DBLock lk(txn->lockState(), ns.db(), newlm::MODE_X);
Client::Context ctx(txn, ns);
long long n = executor.execute(ctx.db());
@@ -914,7 +914,7 @@ namespace mongo {
uassertStatusOK(status);
}
- Lock::DBWrite lk(txn->lockState(), ns);
+ Lock::DBLock lk(txn->lockState(), nsString.db(), newlm::MODE_X);
// CONCURRENCY TODO: is being read locked in big log sufficient here?
// writelock is used to synchronize stepdowns w/ writes