summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorKristina <kristina@10gen.com>2012-12-26 19:53:37 -0500
committerKristina <kristina@10gen.com>2012-12-26 19:53:41 -0500
commit283fc0d291c196232cebc8b964178037aa71f943 (patch)
tree2ceae2c421b1e9b314c6b051e900a87a8485cc43 /src/mongo
parentb012f057c65f112f83d7bf49a0fcd885188fa41b (diff)
downloadmongo-283fc0d291c196232cebc8b964178037aa71f943.tar.gz
SERVER-2771 Make foreground indexes not create a client
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/index_builder.cpp6
-rw-r--r--src/mongo/db/index_builder.h2
-rw-r--r--src/mongo/db/oplog.cpp2
3 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp
index c91f3ea55bf..105a76334e9 100644
--- a/src/mongo/db/index_builder.cpp
+++ b/src/mongo/db/index_builder.cpp
@@ -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;
diff --git a/src/mongo/db/index_builder.h b/src/mongo/db/index_builder.h
index 802836d9252..0b5de273c84 100644
--- a/src/mongo/db/index_builder.h
+++ b/src/mongo/db/index_builder.h
@@ -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.
diff --git a/src/mongo/db/oplog.cpp b/src/mongo/db/oplog.cpp
index dd932cf539b..15f9bfc40ee 100644
--- a/src/mongo/db/oplog.cpp
+++ b/src/mongo/db/oplog.cpp
@@ -775,7 +775,7 @@ namespace mongo {
else {
IndexBuilder builder(ns, o);
// Finish the foreground build before returning
- builder.run();
+ builder.build();
}
}
else {