summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/all_database_cloner.cpp
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
commit4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch)
tree1682a647d4463397c119183369ae6f750d5fdcff /src/mongo/db/repl/all_database_cloner.cpp
parentaa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff)
parent8f0827553e09872941945a093b647a4211a9db7f (diff)
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0' with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'src/mongo/db/repl/all_database_cloner.cpp')
-rw-r--r--src/mongo/db/repl/all_database_cloner.cpp17
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 {