summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency/locker.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2016-09-14 15:10:22 -0400
committerMathias Stearn <mathias@10gen.com>2016-09-16 16:52:29 -0400
commit91ab6853106b59f9583df7eb14716a8ec932c216 (patch)
tree38326a331e51f8b642618b8cf2133cd2694b9050 /src/mongo/db/concurrency/locker.h
parentdc83fb0433fcae6e72f035df7458473b59223eb5 (diff)
downloadmongo-91ab6853106b59f9583df7eb14716a8ec932c216.tar.gz
SERVER-26005 FTDC shouldn't conflict with secondary batch application
Diffstat (limited to 'src/mongo/db/concurrency/locker.h')
-rw-r--r--src/mongo/db/concurrency/locker.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mongo/db/concurrency/locker.h b/src/mongo/db/concurrency/locker.h
index 2bd075ff2a3..55c1f93f200 100644
--- a/src/mongo/db/concurrency/locker.h
+++ b/src/mongo/db/concurrency/locker.h
@@ -302,13 +302,24 @@ public:
*/
virtual bool hasLockPending() const = 0;
- // Used for the replication parallel oplog application threads to prevent any other threads from
- // using the system while it is in an inconsistent state.
- virtual void setIsBatchWriter(bool newValue) = 0;
- virtual bool isBatchWriter() const = 0;
+ /**
+ * If set to false, this opts out of conflicting with replication's use of the
+ * ParallelBatchWriterMode lock. Code that opts-out must be ok with seeing an inconsistent view
+ * of data because within a batch, secondaries apply operations in a different order than on the
+ * primary. User operations should *never* opt out.
+ */
+ void setShouldConflictWithSecondaryBatchApplication(bool newValue) {
+ _shouldConflictWithSecondaryBatchApplication = newValue;
+ }
+ bool shouldConflictWithSecondaryBatchApplication() const {
+ return _shouldConflictWithSecondaryBatchApplication;
+ }
protected:
Locker() {}
+
+private:
+ bool _shouldConflictWithSecondaryBatchApplication = true;
};
} // namespace mongo