diff options
Diffstat (limited to 'src/mongo/db/db_raii.cpp')
-rw-r--r-- | src/mongo/db/db_raii.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp index fa9bd68f338..1cba6635cf0 100644 --- a/src/mongo/db/db_raii.cpp +++ b/src/mongo/db/db_raii.cpp @@ -36,6 +36,7 @@ #include "mongo/db/catalog/database_holder.h" #include "mongo/db/concurrency/locker.h" #include "mongo/db/curop.h" +#include "mongo/db/db_raii_gen.h" #include "mongo/db/repl/replication_coordinator.h" #include "mongo/db/s/collection_sharding_state.h" #include "mongo/db/server_parameters.h" @@ -49,10 +50,6 @@ const boost::optional<int> kDoNotChangeProfilingLevel = boost::none; } // namespace -// If true, do not take the PBWM lock in AutoGetCollectionForRead on secondaries during batch -// application. -MONGO_EXPORT_SERVER_PARAMETER(allowSecondaryReadsDuringBatchApplication, bool, true); - AutoStatsTracker::AutoStatsTracker(OperationContext* opCtx, const NamespaceString& nss, Top::LockType lockType, @@ -93,7 +90,7 @@ AutoGetCollectionForRead::AutoGetCollectionForRead(OperationContext* opCtx, Date_t deadline) { // Don't take the ParallelBatchWriterMode lock when the server parameter is set and our // storage engine supports snapshot reads. - if (allowSecondaryReadsDuringBatchApplication.load() && + if (gAllowSecondaryReadsDuringBatchApplication.load() && opCtx->getServiceContext()->getStorageEngine()->supportsReadConcernSnapshot()) { _shouldNotConflictWithSecondaryBatchApplicationBlock.emplace(opCtx->lockState()); } |