summaryrefslogtreecommitdiff
path: root/src/mongo/db/write_concern.cpp
diff options
context:
space:
mode:
authorKevin Pulo <kevin.pulo@mongodb.com>2020-01-15 01:19:58 +0000
committerevergreen <evergreen@mongodb.com>2020-01-15 01:19:58 +0000
commitf22f71a0d3b10a8bfcf69d078621b240a67cf515 (patch)
treebac3f18ee89b0bbc813ce7c542e0b3fd01a800fc /src/mongo/db/write_concern.cpp
parent2149c69b419c26042b98229f5c289511ca0bad26 (diff)
downloadmongo-f22f71a0d3b10a8bfcf69d078621b240a67cf515.tar.gz
SERVER-45476 Don't consider applying RWC defaults on standalones
Diffstat (limited to 'src/mongo/db/write_concern.cpp')
-rw-r--r--src/mongo/db/write_concern.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mongo/db/write_concern.cpp b/src/mongo/db/write_concern.cpp
index dc49680b32d..c95a377ed9d 100644
--- a/src/mongo/db/write_concern.cpp
+++ b/src/mongo/db/write_concern.cpp
@@ -89,6 +89,7 @@ StatusWith<WriteConcernOptions> extractWriteConcern(OperationContext* opCtx,
// received by shard and config servers should always have WC explicitly specified.
if (serverGlobalParams.clusterRole != ClusterRole::ShardServer &&
serverGlobalParams.clusterRole != ClusterRole::ConfigServer &&
+ repl::ReplicationCoordinator::get(opCtx)->isReplEnabled() &&
!opCtx->inMultiDocumentTransaction() && !opCtx->getClient()->isInDirectClient()) {
auto wcDefault = ReadWriteConcernDefaults::get(opCtx->getServiceContext())
.getDefaultWriteConcern(opCtx);