summaryrefslogtreecommitdiff
path: root/src/mongo/s
diff options
context:
space:
mode:
authorGeert Bosch <geert@mongodb.com>2014-10-03 17:25:41 -0400
committerGeert Bosch <geert@mongodb.com>2014-10-03 17:25:41 -0400
commitf2daf8addd4ef391c135a3da2a1472777405ba06 (patch)
tree0e53c98e5ca8a317cd90e75ba5c3cff66cae5ad1 /src/mongo/s
parent6d8ef4551dfb1e76b480602e8f1d6224656e5841 (diff)
downloadmongo-f2daf8addd4ef391c135a3da2a1472777405ba06.tar.gz
Revert "SERVER-14668: Replace uses of DBWrite lock with DBLock"
This reverts commit da599844c97ef6d290c03e073a9bafe41c1a914e. Conflicts: src/mongo/db/repl/repl_coordinator_external_state_impl.cpp src/mongo/dbtests/counttests.cpp src/mongo/dbtests/querytests.cpp
Diffstat (limited to 'src/mongo/s')
-rw-r--r--src/mongo/s/d_merge.cpp2
-rw-r--r--src/mongo/s/d_migrate.cpp10
-rw-r--r--src/mongo/s/d_split.cpp2
-rw-r--r--src/mongo/s/d_state.cpp4
4 files changed, 9 insertions, 9 deletions
diff --git a/src/mongo/s/d_merge.cpp b/src/mongo/s/d_merge.cpp
index bdfcda69b6b..ac2f415a047 100644
--- a/src/mongo/s/d_merge.cpp
+++ b/src/mongo/s/d_merge.cpp
@@ -293,7 +293,7 @@ namespace mongo {
//
{
- Lock::DBLock writeLk(txn->lockState(), nss.db(), newlm::MODE_X);
+ Lock::DBWrite writeLk(txn->lockState(), nss.ns());
shardingState.mergeChunks(txn, nss.ns(), minKey, maxKey, mergeVersion);
}
diff --git a/src/mongo/s/d_migrate.cpp b/src/mongo/s/d_migrate.cpp
index eaf59dea53c..6f8ba1b0bf0 100644
--- a/src/mongo/s/d_migrate.cpp
+++ b/src/mongo/s/d_migrate.cpp
@@ -1242,7 +1242,7 @@ namespace mongo {
myVersion.incMajor();
{
- Lock::DBLock lk(txn->lockState(), nsToDatabaseSubstring(ns), newlm::MODE_X);
+ Lock::DBWrite lk(txn->lockState(), ns );
verify( myVersion > shardingState.getVersion( ns ) );
// bump the metadata's version up and "forget" about the chunk being moved
@@ -1656,7 +1656,7 @@ namespace mongo {
if ( getState() != DONE ) {
// Unprotect the range if needed/possible on unsuccessful TO migration
- Lock::DBLock lk(txn->lockState(), nsToDatabaseSubstring(ns), newlm::MODE_X);
+ Lock::DBWrite lk(txn->lockState(), ns);
string errMsg;
if (!shardingState.forgetPending(txn, ns, min, max, epoch, &errMsg)) {
warning() << errMsg << endl;
@@ -1714,7 +1714,7 @@ namespace mongo {
indexSpecs.insert(indexSpecs.begin(), indexes.begin(), indexes.end());
}
- Lock::DBLock lk(txn->lockState(), nsToDatabaseSubstring(ns), newlm::MODE_X);
+ Lock::DBWrite lk(txn->lockState(), ns);
Client::Context ctx(txn, ns);
Database* db = ctx.db();
Collection* collection = db->getCollection( txn, ns );
@@ -1799,7 +1799,7 @@ namespace mongo {
{
// Protect the range by noting that we're now starting a migration to it
- Lock::DBLock lk(txn->lockState(), nsToDatabaseSubstring(ns), newlm::MODE_X);
+ Lock::DBWrite lk(txn->lockState(), ns);
if (!shardingState.notePending(txn, ns, min, max, epoch, &errmsg)) {
warning() << errmsg << endl;
setState(FAIL);
@@ -2099,7 +2099,7 @@ namespace mongo {
}
}
- Lock::DBLock lk(txn->lockState(), nsToDatabaseSubstring(ns), newlm::MODE_X);
+ Lock::DBWrite lk(txn->lockState(), ns);
Client::Context ctx(txn, ns);
if (serverGlobalParams.moveParanoia) {
diff --git a/src/mongo/s/d_split.cpp b/src/mongo/s/d_split.cpp
index e745899eaf3..721678695e5 100644
--- a/src/mongo/s/d_split.cpp
+++ b/src/mongo/s/d_split.cpp
@@ -787,7 +787,7 @@ namespace mongo {
//
{
- Lock::DBLock writeLk(txn->lockState(), nsToDatabaseSubstring(ns), newlm::MODE_X);
+ Lock::DBWrite writeLk(txn->lockState(), ns);
// NOTE: The newShardVersion resulting from this split is higher than any
// other chunk version, so it's also implicitly the newCollVersion
diff --git a/src/mongo/s/d_state.cpp b/src/mongo/s/d_state.cpp
index 71340b94288..24928c69400 100644
--- a/src/mongo/s/d_state.cpp
+++ b/src/mongo/s/d_state.cpp
@@ -595,7 +595,7 @@ namespace mongo {
{
// DBLock needed since we're now potentially changing the metadata, and don't want
// reads/writes to be ongoing.
- Lock::DBLock writeLk(txn->lockState(), nsToDatabaseSubstring(ns), newlm::MODE_X);
+ Lock::DBWrite writeLk(txn->lockState(), ns );
//
// Get the metadata now that the load has completed
@@ -1298,7 +1298,7 @@ namespace mongo {
}
bool run(OperationContext* txn, const string& dbname, BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool) {
- Lock::DBLock dbXLock(txn->lockState(), dbname, newlm::MODE_X);
+ Lock::DBWrite dbXLock(txn->lockState(), dbname);
Client::Context ctx(txn, dbname);
shardingState.appendInfo( result );