diff options
author | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2016-10-13 18:15:32 -0400 |
---|---|---|
committer | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2016-11-04 19:12:51 -0400 |
commit | f00448255bbb24c07e2f55e7e229f19e316350a6 (patch) | |
tree | a00435a63185256c3f27dfae0f97cff745459973 /src/mongo/db/index_builder.h | |
parent | 361efe3a8d6675b258b92a6f701a98123c4b613d (diff) | |
download | mongo-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.h | 5 |
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; }; |