summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_rebuilder.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2014-07-30 17:34:46 -0400
committerMathias Stearn <mathias@10gen.com>2014-08-13 17:30:25 -0400
commit00913e47de5aced5267e44e82ac9e976bbaac089 (patch)
tree26002b9f1eb4e7b3f295bd2a4cf24a68aa13cad3 /src/mongo/db/index_rebuilder.h
parentc610cfe5c58d1f4301f5535d3e166d5d4332bc87 (diff)
downloadmongo-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/db/index_rebuilder.h')
-rw-r--r--src/mongo/db/index_rebuilder.h30
1 files changed, 5 insertions, 25 deletions
diff --git a/src/mongo/db/index_rebuilder.h b/src/mongo/db/index_rebuilder.h
index 71e8bd55952..4fd59b14966 100644
--- a/src/mongo/db/index_rebuilder.h
+++ b/src/mongo/db/index_rebuilder.h
@@ -28,31 +28,11 @@
#pragma once
-#include <list>
-#include <string>
-
-#include "mongo/util/background.h"
-
namespace mongo {
- class OperationContext;
-
- // This is a job that's only run at startup. It finds all incomplete indices and
- // finishes rebuilding them. After they complete rebuilding, the thread terminates.
- class IndexRebuilder : public BackgroundJob {
- public:
- IndexRebuilder();
-
- std::string name() const;
- void run();
-
- private:
- /**
- * Check each collection in the passed in list to see if it has any in-progress index
- * builds that need to be retried. If so, calls retryIndexBuild.
- */
- void checkNS(OperationContext* txn, const std::list<std::string>& nsToCheck);
- };
-
- extern IndexRebuilder indexRebuilder;
+ /**
+ * Restarts building indexes that were in progress during shutdown.
+ * Only call this at startup before taking requests.
+ */
+ void restartInProgressIndexesFromLastShutdown();
}