summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_builder.cpp
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2014-04-30 16:24:00 -0400
committerHari Khalsa <hkhalsa@10gen.com>2014-04-30 16:26:38 -0400
commit5fc98b83d4b68e87493bbe468f2da396b4576568 (patch)
tree81e99fdd56bc3f6c7c4a5338313256c293dcdf6d /src/mongo/db/index_builder.cpp
parent22ac42b23ca0f9dd80a62091098b4477944bafcb (diff)
downloadmongo-5fc98b83d4b68e87493bbe468f2da396b4576568.tar.gz
SERVER-13643 have index builder use TransactionExperiment
Diffstat (limited to 'src/mongo/db/index_builder.cpp')
-rw-r--r--src/mongo/db/index_builder.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp
index 0a0a808fd90..8f6ff9c6051 100644
--- a/src/mongo/db/index_builder.cpp
+++ b/src/mongo/db/index_builder.cpp
@@ -62,8 +62,9 @@ namespace mongo {
cc().curop()->reset(HostAndPort(), dbInsert);
NamespaceString ns(_index["ns"].String());
Client::WriteContext ctx(ns.getSystemIndexesCollection());
+ DurTransaction txn;
- Status status = build( ctx.ctx() );
+ Status status = build(&txn, ctx.ctx());
if ( !status.isOK() ) {
log() << "IndexBuilder could not build index: " << status.toString();
}
@@ -71,7 +72,9 @@ namespace mongo {
cc().shutdown();
}
- Status IndexBuilder::build( Client::Context& context ) const {
+ Status IndexBuilder::build(TransactionExperiment* txn,
+ Client::Context& context ) const {
+
string ns = _index["ns"].String();
Database* db = context.db();
Collection* c = db->getCollection( ns );
@@ -83,8 +86,7 @@ namespace mongo {
// Show which index we're building in the curop display.
context.getClient()->curop()->setQuery(_index);
- DurTransaction txn; // XXX
- Status status = c->getIndexCatalog()->createIndex( &txn,
+ Status status = c->getIndexCatalog()->createIndex( txn,
_index,
true,
IndexCatalog::SHUTDOWN_LEAVE_DIRTY );