diff options
Diffstat (limited to 'src/mongo/db/repl/master_slave.cpp')
-rw-r--r-- | src/mongo/db/repl/master_slave.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp index bdbbc14cc41..2b3eca3de42 100644 --- a/src/mongo/db/repl/master_slave.cpp +++ b/src/mongo/db/repl/master_slave.cpp @@ -196,10 +196,9 @@ namespace repl { LOG( 1 ) << "Saving repl source: " << o << endl; { - OperationContextImpl txn; OpDebug debug; - - Client::Context ctx(&txn, "local.sources"); + Client::Context ctx("local.sources"); + OperationContextImpl txn; const NamespaceString requestNs("local.sources"); UpdateRequest request(requestNs); @@ -235,7 +234,7 @@ namespace repl { */ void ReplSource::loadAll(OperationContext* txn, SourceVector &v) { const char* localSources = "local.sources"; - Client::Context ctx(txn, localSources); + Client::Context ctx(localSources); SourceVector old = v; v.clear(); @@ -365,7 +364,7 @@ namespace repl { void ReplSource::resyncDrop( OperationContext* txn, const string& db ) { log() << "resync: dropping database " << db; - Client::Context ctx(txn, db); + Client::Context ctx(db); dropDatabase(txn, ctx.db()); } @@ -514,9 +513,8 @@ namespace repl { ___databaseIgnorer.doIgnoreUntilAfter( *i, lastTime ); incompleteCloneDbs.erase(*i); addDbNextPass.erase(*i); - - Client::Context ctx(txn, *i); - dropDatabase(txn, ctx.db()); + Client::Context ctx(*i); + dropDatabase(txn, ctx.db() ); } massert(14034, "Duplicate database names present after attempting to delete duplicates", @@ -628,11 +626,11 @@ namespace repl { if (!handleDuplicateDbName(txn, op, ns, clientName)) { return; } - + // This code executes on the slaves only, so it doesn't need to be sharding-aware since // mongos will not send requests there. That's why the last argument is false (do not do // version checking). - Client::Context ctx(txn, ns, false); + Client::Context ctx(ns, false); ctx.getClient()->curop()->reset(); bool empty = ctx.db()->getDatabaseCatalogEntry()->isEmpty(); @@ -663,7 +661,7 @@ namespace repl { log() << "An earlier initial clone of '" << clientName << "' did not complete, now resyncing." << endl; } save(); - Client::Context ctx(txn, ns); + Client::Context ctx(ns); nClonedThisPass++; resync(txn, ctx.db()->name()); addDbNextPass.erase(clientName); @@ -1287,7 +1285,7 @@ namespace repl { BSONObjBuilder b; b.append(_id); BSONObj result; - Client::Context ctx(&txn, ns); + Client::Context ctx( ns ); if( Helpers::findById(&txn, ctx.db(), ns, b.done(), result) ) _dummy_z += result.objsize(); // touch } |