summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierlauro Sciarelli <pierlauro.sciarelli@mongodb.com>2022-01-11 19:19:08 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-11 20:07:11 +0000
commite9eb68e62f9e9006f770c7cf37c933727063d450 (patch)
tree657f3bf966c40ca4e0be10004054824c720024d2
parent47f4bcad59f659fe7e521ba154631f50da2a0026 (diff)
downloadmongo-e9eb68e62f9e9006f770c7cf37c933727063d450.tar.gz
SERVER-62424 _configsvrRemoveShard must wait for majority before returning
-rw-r--r--src/mongo/db/s/config/configsvr_remove_shard_command.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/s/config/configsvr_remove_shard_command.cpp b/src/mongo/db/s/config/configsvr_remove_shard_command.cpp
index 7476c4b9aba..16e74bb3dbf 100644
--- a/src/mongo/db/s/config/configsvr_remove_shard_command.cpp
+++ b/src/mongo/db/s/config/configsvr_remove_shard_command.cpp
@@ -41,6 +41,7 @@
#include "mongo/db/commands.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/repl/read_concern_args.h"
+#include "mongo/db/repl/repl_client_info.h"
#include "mongo/db/s/config/sharding_catalog_manager.h"
#include "mongo/logv2/log.h"
#include "mongo/s/catalog/type_database.h"
@@ -104,6 +105,10 @@ public:
<< cmdObj,
opCtx->getWriteConcern().wMode == WriteConcernOptions::kMajority);
+ ON_BLOCK_EXIT([&opCtx] {
+ repl::ReplClientInfo::forClient(opCtx->getClient()).setLastOpToSystemLastOpTime(opCtx);
+ });
+
// Set the operation context read concern level to local for reads into the config database.
repl::ReadConcernArgs::get(opCtx) =
repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern);