summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_rebuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/index_rebuilder.cpp')
-rw-r--r--src/mongo/db/index_rebuilder.cpp12
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();