Skip to content

Commit

Permalink
SERVER-2771 Make foreground indexes not create a client
Browse files Browse the repository at this point in the history
  • Loading branch information
kchodorow committed Dec 27, 2012
1 parent b012f05 commit 283fc0d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/mongo/db/index_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,16 @@ namespace mongo {
Client::WriteContext ctx(_ns);
theDataFileMgr.insert(_ns.c_str(), _index.objdata(), _index.objsize(),
true /* mayInterrupt */);
build();

cc().shutdown();
}

void IndexBuilder::build() const {
theDataFileMgr.insert(_ns.c_str(), _index.objdata(), _index.objsize(),
true /* mayInterrupt */);
}

std::vector<BSONObj> IndexBuilder::killMatchingIndexBuilds(const BSONObj& criteria) {
std::vector<BSONObj> indexes;
CurOp* op = NULL;
Expand Down
2 changes: 2 additions & 0 deletions src/mongo/db/index_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ namespace mongo {
virtual void run();
virtual std::string name() const;

void build() const;

/**
* Kill all in-progress indexes matching criteria and, optionally, store them in the
* indexes list.
Expand Down
2 changes: 1 addition & 1 deletion src/mongo/db/oplog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ namespace mongo {
else {
IndexBuilder builder(ns, o);
// Finish the foreground build before returning
builder.run();
builder.build();
}
}
else {
Expand Down

0 comments on commit 283fc0d

Please sign in to comment.