From f00448255bbb24c07e2f55e7e229f19e316350a6 Mon Sep 17 00:00:00 2001 From: Siyuan Zhou Date: Thu, 13 Oct 2016 18:15:32 -0400 Subject: SERVER-26202 Relax index constraints in oplog application --- src/mongo/db/index_builder.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/index_builder.h') 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; }; -- cgit v1.2.1