diff options
-rw-r--r-- | src/mongo/db/repl/oplog_applier.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/repl/sync_tail.cpp | 17 | ||||
-rw-r--r-- | src/mongo/db/repl/sync_tail.h | 14 |
3 files changed, 30 insertions, 3 deletions
diff --git a/src/mongo/db/repl/oplog_applier.cpp b/src/mongo/db/repl/oplog_applier.cpp index 1791f45566a..1f573cb72c2 100644 --- a/src/mongo/db/repl/oplog_applier.cpp +++ b/src/mongo/db/repl/oplog_applier.cpp @@ -56,7 +56,7 @@ OplogApplier::OplogApplier(executor::TaskExecutor* executor, _storageInterface(storageInterface), _options(options), _syncTail(std::make_unique<SyncTail>( - _observer, _consistencyMarkers, _storageInterface, multiSyncApply, writerPool)) { + _observer, _consistencyMarkers, _storageInterface, multiSyncApply, writerPool, options)) { invariant(!options.allowNamespaceNotFoundErrorsOnCrudOps); invariant(!options.relaxUniqueIndexConstraints); } diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp index f0055a5405b..785b12ce280 100644 --- a/src/mongo/db/repl/sync_tail.cpp +++ b/src/mongo/db/repl/sync_tail.cpp @@ -391,15 +391,28 @@ SyncTail::SyncTail(OplogApplier::Observer* observer, ReplicationConsistencyMarkers* consistencyMarkers, StorageInterface* storageInterface, MultiSyncApplyFunc func, - ThreadPool* writerPool) + ThreadPool* writerPool, + const OplogApplier::Options& options) : _observer(observer), _consistencyMarkers(consistencyMarkers), _storageInterface(storageInterface), _applyFunc(func), - _writerPool(writerPool) {} + _writerPool(writerPool), + _options(options) {} + +SyncTail::SyncTail(OplogApplier::Observer* observer, + ReplicationConsistencyMarkers* consistencyMarkers, + StorageInterface* storageInterface, + MultiSyncApplyFunc func, + ThreadPool* writerPool) + : SyncTail(observer, consistencyMarkers, storageInterface, func, writerPool, {}) {} SyncTail::~SyncTail() {} +const OplogApplier::Options& SyncTail::getOptions() const { + return _options; +} + namespace { // The pool threads call this to prefetch each op diff --git a/src/mongo/db/repl/sync_tail.h b/src/mongo/db/repl/sync_tail.h index 284e7227cf8..ecf558bea43 100644 --- a/src/mongo/db/repl/sync_tail.h +++ b/src/mongo/db/repl/sync_tail.h @@ -98,10 +98,21 @@ public: ReplicationConsistencyMarkers* consistencyMarkers, StorageInterface* storageInterface, MultiSyncApplyFunc func, + ThreadPool* writerPool, + const OplogApplier::Options& options); + SyncTail(OplogApplier::Observer* observer, + ReplicationConsistencyMarkers* consistencyMarkers, + StorageInterface* storageInterface, + MultiSyncApplyFunc func, ThreadPool* writerPool); virtual ~SyncTail(); /** + * Returns options for oplog application. + */ + const OplogApplier::Options& getOptions() const; + + /** * Runs oplog application in a loop until shutdown() is called. * Retrieves operations from the OplogBuffer in batches that will be applied in parallel using * multiApply(). @@ -264,6 +275,9 @@ private: // Not owned by us. ThreadPool* const _writerPool; + // Used to configure multiApply() behavior. + const OplogApplier::Options _options; + // Protects member data of SyncTail. mutable stdx::mutex _mutex; |