diff options
Diffstat (limited to 'src/mongo/db/repl/all_database_cloner.cpp')
| -rw-r--r-- | src/mongo/db/repl/all_database_cloner.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mongo/db/repl/all_database_cloner.cpp b/src/mongo/db/repl/all_database_cloner.cpp index 6f6d73cefec..b5856b7aef0 100644 --- a/src/mongo/db/repl/all_database_cloner.cpp +++ b/src/mongo/db/repl/all_database_cloner.cpp @@ -59,17 +59,16 @@ BaseCloner::ClonerStages AllDatabaseCloner::getStages() { } Status AllDatabaseCloner::ensurePrimaryOrSecondary( - const executor::RemoteCommandResponse& helloReply) { - if (!helloReply.isOK()) { - LOGV2(21054, "Cannot reconnect because 'hello' command failed"); - return helloReply.status; + const executor::RemoteCommandResponse& isMasterReply) { + if (!isMasterReply.isOK()) { + LOGV2(21054, "Cannot reconnect because isMaster command failed"); + return isMasterReply.status; } - if (helloReply.data["isWritablePrimary"].trueValue() || - helloReply.data["secondary"].trueValue()) + if (isMasterReply.data["ismaster"].trueValue() || isMasterReply.data["secondary"].trueValue()) return Status::OK(); // There is a window during startup where a node has an invalid configuration and will have - // an "hello" response the same as a removed node. So we must check to see if the node is + // an isMaster response the same as a removed node. So we must check to see if the node is // removed by checking local configuration. auto memberData = ReplicationCoordinator::get(getGlobalServiceContext())->getMemberData(); auto syncSourceIter = std::find_if( @@ -110,8 +109,8 @@ BaseCloner::AfterStageBehavior AllDatabaseCloner::connectStage() { // handle the reconnect itself. This is necessary to get correct backoff behavior. if (client->getServerHostAndPort() != getSource()) { client->setHandshakeValidationHook( - [this](const executor::RemoteCommandResponse& helloReply) { - return ensurePrimaryOrSecondary(helloReply); + [this](const executor::RemoteCommandResponse& isMasterReply) { + return ensurePrimaryOrSecondary(isMasterReply); }); uassertStatusOK(client->connect(getSource(), StringData(), boost::none)); } else { |
