summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/strategy.cpp
diff options
context:
space:
mode:
authorMoustafa Maher <m.maher@10gen.com>2021-06-02 01:21:58 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-04 19:07:24 +0000
commit914174babe1dc163615c0f031db8744aff7d2c8d (patch)
tree3147f74fb93bffa40c987f9e04143e365e40e1ea /src/mongo/s/commands/strategy.cpp
parentb17e0a99632872e44684700978d55c01be1a7895 (diff)
downloadmongo-914174babe1dc163615c0f031db8744aff7d2c8d.tar.gz
SERVER-56694 implicit default majority write concern should set usedDefault=false
Diffstat (limited to 'src/mongo/s/commands/strategy.cpp')
-rw-r--r--src/mongo/s/commands/strategy.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/s/commands/strategy.cpp b/src/mongo/s/commands/strategy.cpp
index a50c52b77f4..5e35533fffc 100644
--- a/src/mongo/s/commands/strategy.cpp
+++ b/src/mongo/s/commands/strategy.cpp
@@ -648,7 +648,10 @@ Status ParseAndRunCommand::RunInvocation::_setup() {
return appendStatusToReplyAndSkipCommandExecution({ErrorCodes::InvalidOptions, errorMsg});
}
- bool clientSuppliedWriteConcern = !_parc->_wc->usedDefault;
+ // This is the WC extracted from the command object, so the CWWC or implicit default hasn't been
+ // applied yet, which is why "usedDefaultConstructedWC" flag can be used an indicator of whether
+ // the client supplied a WC or not.
+ bool clientSuppliedWriteConcern = !_parc->_wc->usedDefaultConstructedWC;
bool customDefaultWriteConcernWasApplied = false;
bool isInternalClient =
(opCtx->getClient()->session() &&