summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMoustafa Maher <m.maher@10gen.com>2021-07-28 00:48:41 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-08-10 06:37:27 +0000
commitbc0b19fd6df42983a3c265fe8c6015439c9878b2 (patch)
tree746952233af77b83624ee5617c634509745201bd /src
parent081648d6c77cfaab1688ed762aff14c665a72415 (diff)
downloadmongo-bc0b19fd6df42983a3c265fe8c6015439c9878b2.tar.gz
SERVER-58898 Prevent writing to local db from waiting for writeConcern
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/service_entry_point_mongod.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/service_entry_point_mongod.cpp b/src/mongo/db/service_entry_point_mongod.cpp
index 00fbaea5764..71be1d02ba4 100644
--- a/src/mongo/db/service_entry_point_mongod.cpp
+++ b/src/mongo/db/service_entry_point_mongod.cpp
@@ -114,6 +114,13 @@ public:
const CommandInvocation* invocation,
const repl::OpTime& lastOpBeforeRun,
BSONObjBuilder& commandResponseBuilder) const override {
+
+ // Prevent waiting for writeConcern if the command is changing an unreplicated namespace.
+ invariant(invocation);
+ if (!invocation->ns().isReplicated()) {
+ return;
+ }
+
auto lastOpAfterRun = repl::ReplClientInfo::forClient(opCtx->getClient()).getLastOp();
auto waitForWriteConcernAndAppendStatus = [&]() {