summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_builder.h
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2016-10-13 18:15:32 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2016-11-04 19:12:51 -0400
commitf00448255bbb24c07e2f55e7e229f19e316350a6 (patch)
treea00435a63185256c3f27dfae0f97cff745459973 /src/mongo/db/index_builder.h
parent361efe3a8d6675b258b92a6f701a98123c4b613d (diff)
downloadmongo-f00448255bbb24c07e2f55e7e229f19e316350a6.tar.gz
SERVER-26202 Relax index constraints in oplog application
Diffstat (limited to 'src/mongo/db/index_builder.h')
-rw-r--r--src/mongo/db/index_builder.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/index_builder.h b/src/mongo/db/index_builder.h
index 2e87a8198a3..bdca706c108 100644
--- a/src/mongo/db/index_builder.h
+++ b/src/mongo/db/index_builder.h
@@ -59,10 +59,12 @@ class OperationContext;
* ensured by the replication system, since commands are effectively run single-threaded
* by the replication applier, and index builds are treated as commands even though they look
* like inserts on system.indexes.
+ * The argument "relaxConstraints" specifies whether we should honor or ignore index constraints,
+ * The ignoring of constraints is for replication due to idempotency reasons.
*/
class IndexBuilder : public BackgroundJob {
public:
- IndexBuilder(const BSONObj& index);
+ IndexBuilder(const BSONObj& index, bool relaxConstraints);
virtual ~IndexBuilder();
virtual void run();
@@ -88,6 +90,7 @@ private:
Lock::DBLock* dbLock) const;
const BSONObj _index;
+ const bool _relaxConstraints;
std::string _name; // name of this builder, not related to the index
static AtomicUInt32 _indexBuildCount;
};