Skip to content

Commit

Permalink
SERVER-8344 Do not recursively lock during index rebuilds
Browse files Browse the repository at this point in the history
  • Loading branch information
kchodorow committed Feb 8, 2013
1 parent 5ecb17b commit 084f269
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/mongo/db/index_rebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@ namespace mongo {
Record::MemoryTrackingEnabled = false;

Client::initThread(name().c_str());
Lock::GlobalWrite lk;
Client::GodScope gs;
std::vector<std::string> dbNames;
getDatabaseNames(dbNames);

{
Lock::GlobalWrite lk;
Client::GodScope gs;
getDatabaseNames(dbNames);
}

for (std::vector<std::string>::const_iterator it = dbNames.begin();
it < dbNames.end();
Expand All @@ -73,7 +76,7 @@ namespace mongo {
BSONObj nsDoc = cursor->next();
const char* ns = nsDoc["name"].valuestrsafe();

Client::Context ctx(ns, dbpath, false);
Client::WriteContext ctx(ns);
NamespaceDetails* nsd = nsdetails(ns);

if (!nsd || !nsd->indexBuildsInProgress) {
Expand Down

0 comments on commit 084f269

Please sign in to comment.