diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2020-01-16 21:22:45 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2020-01-16 21:22:45 +0000 |
commit | 1d86760bbdf23491846640898229c56084e3def2 (patch) | |
tree | 2f2bcc7879d8f9d83eaa729352b8692796dc90f0 /src/mongo | |
parent | a610dc6d69e6a14758e8160dbf94aee258d19494 (diff) | |
download | mongo-1d86760bbdf23491846640898229c56084e3def2.tar.gz |
SERVER-44814 Support waitInIsMaster failpoint on mongos
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/s/commands/cluster_is_master_cmd.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/s/commands/cluster_is_master_cmd.cpp b/src/mongo/s/commands/cluster_is_master_cmd.cpp index f345ea41297..af00e62bd09 100644 --- a/src/mongo/s/commands/cluster_is_master_cmd.cpp +++ b/src/mongo/s/commands/cluster_is_master_cmd.cpp @@ -44,6 +44,9 @@ #include "mongo/util/version.h" namespace mongo { + +MONGO_FAIL_POINT_DEFINE(waitInIsMaster); + namespace { class CmdIsMaster : public BasicCommand { @@ -77,6 +80,9 @@ public: const BSONObj& cmdObj, BSONObjBuilder& result) override { CommandHelpers::handleMarkKillOnClientDisconnect(opCtx); + + waitInIsMaster.pauseWhileSet(opCtx); + auto& clientMetadataIsMasterState = ClientMetadataIsMasterState::get(opCtx->getClient()); bool seenIsMaster = clientMetadataIsMasterState.hasSeenIsMaster(); if (!seenIsMaster) { |