diff options
author | Eric Milkie <milkie@10gen.com> | 2015-06-01 13:55:15 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2015-06-04 09:10:05 -0400 |
commit | bc44c26302d2f377bc0cefb4e8fbffa247d18db6 (patch) | |
tree | 24335e29f9b349860a97c51331b399c41cd6edab /src/mongo/db/index_builder.cpp | |
parent | 167d6de7241570e8bc73bcd8878fe91f1f77c12a (diff) | |
download | mongo-bc44c26302d2f377bc0cefb4e8fbffa247d18db6.tar.gz |
SERVER-17923 prohibit database/collection actions when bg index is running
Diffstat (limited to 'src/mongo/db/index_builder.cpp')
-rw-r--r-- | src/mongo/db/index_builder.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp index 45620ee0544..6d205c45da9 100644 --- a/src/mongo/db/index_builder.cpp +++ b/src/mongo/db/index_builder.cpp @@ -155,7 +155,6 @@ namespace { indexer.allowBackgroundBuilding(); - IndexDescriptor* descriptor(NULL); try { status = indexer.init(_index); if ( status.code() == ErrorCodes::IndexAlreadyExists ) { @@ -168,7 +167,6 @@ namespace { if (status.isOK()) { if (allowBackgroundBuilding) { - descriptor = indexer.registerIndexBuild(); if (!haveSetBgIndexStarting) { _setBgIndexStarting(); haveSetBgIndexStarting = true; @@ -199,7 +197,6 @@ namespace { Database* reloadDb = dbHolder().get(txn, ns.db()); fassert(28553, reloadDb); fassert(28554, reloadDb->getCollection(ns.ns())); - indexer.unregisterIndexBuild(descriptor); } if (status.code() == ErrorCodes::InterruptedAtShutdown) { @@ -219,22 +216,4 @@ namespace { txn->recoveryUnit()->abandonSnapshot(); } } - - std::vector<BSONObj> - IndexBuilder::killMatchingIndexBuilds(Collection* collection, - const IndexCatalog::IndexKillCriteria& criteria) { - invariant(collection); - return collection->getIndexCatalog()->killMatchingIndexBuilds(criteria); - } - - void IndexBuilder::restoreIndexes(OperationContext* txn, const std::vector<BSONObj>& indexes) { - log() << "restarting " << indexes.size() << " background index build(s)" << endl; - for (int i = 0; i < static_cast<int>(indexes.size()); i++) { - IndexBuilder* indexBuilder = new IndexBuilder(indexes[i]); - // This looks like a memory leak, but indexBuilder deletes itself when it finishes - indexBuilder->go(); - Lock::TempRelease release(txn->lockState()); - IndexBuilder::waitForBgIndexStarting(); - } - } } |