From 283fc0d291c196232cebc8b964178037aa71f943 Mon Sep 17 00:00:00 2001 From: Kristina Date: Wed, 26 Dec 2012 19:53:37 -0500 Subject: SERVER-2771 Make foreground indexes not create a client --- src/mongo/db/index_builder.cpp | 6 ++++++ src/mongo/db/index_builder.h | 2 ++ src/mongo/db/oplog.cpp | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/mongo') 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 IndexBuilder::killMatchingIndexBuilds(const BSONObj& criteria) { std::vector 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 { -- cgit v1.2.1