diff options
author | Mathias Stearn <mathias@10gen.com> | 2014-07-30 17:34:46 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2014-08-13 17:30:25 -0400 |
commit | 00913e47de5aced5267e44e82ac9e976bbaac089 (patch) | |
tree | 26002b9f1eb4e7b3f295bd2a4cf24a68aa13cad3 /src/mongo/dbtests/indexcatalogtests.cpp | |
parent | c610cfe5c58d1f4301f5535d3e166d5d4332bc87 (diff) | |
download | mongo-00913e47de5aced5267e44e82ac9e976bbaac089.tar.gz |
SERVER-13951 Split index building in to UnitOfWork-sized stages
All index builds now go through the MultiIndexBuilder as its API was already
close to ideal. The following tickets have also been addressed by this commit:
SERVER-14710 Remove dropDups
SERVER-12309 Cloner build indexes in parallel
SERVER-14737 Initial sync uses bg index building
SERVER-9135 fast index build for initial sync
SERVER-2747 can't kill index in phase 2
SERVER-8917 check error code rather than assuming all errors are dups
SERVER-14820 compact enforces unique while claiming not to
SERVER-14746 IndexRebuilder should be foreground and fail fatally
Diffstat (limited to 'src/mongo/dbtests/indexcatalogtests.cpp')
-rw-r--r-- | src/mongo/dbtests/indexcatalogtests.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/mongo/dbtests/indexcatalogtests.cpp b/src/mongo/dbtests/indexcatalogtests.cpp index 21fb94ca24b..7236f6f0b5a 100644 --- a/src/mongo/dbtests/indexcatalogtests.cpp +++ b/src/mongo/dbtests/indexcatalogtests.cpp @@ -18,6 +18,7 @@ #include "mongo/db/catalog/index_catalog.h" #include "mongo/db/db.h" +#include "mongo/db/dbhelpers.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/operation_context_impl.h" @@ -54,17 +55,8 @@ namespace IndexCatalogTests { int numFinishedIndexesStart = _catalog->numIndexesReady(); - BSONObjBuilder b1; - b1.append("key", BSON("x" << 1)); - b1.append("ns", _ns); - b1.append("name", "_x_0"); - _catalog->createIndex(&txn, b1.obj(), true); - - BSONObjBuilder b2; - b2.append("key", BSON("y" << 1)); - b2.append("ns", _ns); - b2.append("name", "_y_0"); - _catalog->createIndex(&txn, b2.obj(), true); + Helpers::ensureIndex(&txn, _coll, BSON("x" << 1), false, "_x_0"); + Helpers::ensureIndex(&txn, _coll, BSON("y" << 1), false, "_y_0"); ASSERT_TRUE(_catalog->numIndexesReady() == numFinishedIndexesStart+2); |