diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-09-26 14:02:49 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-10-06 17:30:12 -0400 |
commit | 101e026f45dea5e9e68520238495c89a476e6172 (patch) | |
tree | bbdd3710ffc5721527ad9f5682ef0dbb4876dfee /src/mongo/db/index_rebuilder.cpp | |
parent | 10c86dc6cad9853514148e0ab59894a0d29353b9 (diff) | |
download | mongo-101e026f45dea5e9e68520238495c89a476e6172.tar.gz |
SERVER-14668/SERVER-15294 Collection-level locking for all read paths
Diffstat (limited to 'src/mongo/db/index_rebuilder.cpp')
-rw-r--r-- | src/mongo/db/index_rebuilder.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mongo/db/index_rebuilder.cpp b/src/mongo/db/index_rebuilder.cpp index cbde00dbf04..22d8e055382 100644 --- a/src/mongo/db/index_rebuilder.cpp +++ b/src/mongo/db/index_rebuilder.cpp @@ -134,10 +134,8 @@ namespace { } } // namespace - void restartInProgressIndexesFromLastShutdown() { - OperationContextImpl txn; - - txn.getClient()->getAuthorizationSession()->grantInternalAuthorization(); + void restartInProgressIndexesFromLastShutdown(OperationContext* txn) { + txn->getClient()->getAuthorizationSession()->grantInternalAuthorization(); std::vector<std::string> dbNames; @@ -149,12 +147,12 @@ namespace { for (std::vector<std::string>::const_iterator dbName = dbNames.begin(); dbName < dbNames.end(); ++dbName) { - Client::ReadContext ctx(&txn, *dbName); + AutoGetDb autoDb(txn, *dbName, newlm::MODE_S); - Database* db = ctx.ctx().db(); + Database* db = autoDb.getDb(); db->getDatabaseCatalogEntry()->getCollectionNamespaces(&collNames); } - checkNS(&txn, collNames); + checkNS(txn, collNames); } catch (const DBException& e) { error() << "Index rebuilding did not complete: " << e.toString(); |