summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/storage_interface_impl.cpp
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2018-12-06 15:53:36 -0500
committerMatthew Russotto <matthew.russotto@10gen.com>2018-12-06 15:53:43 -0500
commit7cc3c41cf8060966545c844e4d83c7d0ff3994e8 (patch)
tree51e480d76a1b9625e62202936ff3114e85105142 /src/mongo/db/repl/storage_interface_impl.cpp
parent28e38550525a1e338ea2882da3ddce518771627f (diff)
downloadmongo-7cc3c41cf8060966545c844e4d83c7d0ff3994e8.tar.gz
SERVER-34620 Make speculative read atClusterTime not wait for the given cluster time to be majority-committed
Diffstat (limited to 'src/mongo/db/repl/storage_interface_impl.cpp')
-rw-r--r--src/mongo/db/repl/storage_interface_impl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/repl/storage_interface_impl.cpp b/src/mongo/db/repl/storage_interface_impl.cpp
index 92a78753ad4..a6ba88502bc 100644
--- a/src/mongo/db/repl/storage_interface_impl.cpp
+++ b/src/mongo/db/repl/storage_interface_impl.cpp
@@ -1124,8 +1124,12 @@ Status StorageInterfaceImpl::isAdminDbValid(OperationContext* opCtx) {
return Status::OK();
}
-void StorageInterfaceImpl::waitForAllEarlierOplogWritesToBeVisible(OperationContext* opCtx) {
+void StorageInterfaceImpl::waitForAllEarlierOplogWritesToBeVisible(OperationContext* opCtx,
+ bool primaryOnly) {
Lock::GlobalLock lk(opCtx, MODE_IS);
+ if (primaryOnly &&
+ !repl::ReplicationCoordinator::get(opCtx)->canAcceptWritesForDatabase(opCtx, "admin"))
+ return;
Collection* oplog;
{
// We don't want to be holding the collection lock while blocking, to avoid deadlocks.