summaryrefslogtreecommitdiff
path: root/src/mongo/client/async_client.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/client/async_client.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/client/async_client.cpp')
-rw-r--r--src/mongo/client/async_client.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mongo/client/async_client.cpp b/src/mongo/client/async_client.cpp
index d8cc8d4fcc9..309475ec36e 100644
--- a/src/mongo/client/async_client.cpp
+++ b/src/mongo/client/async_client.cpp
@@ -73,17 +73,17 @@ Future<AsyncDBClient::Handle> AsyncDBClient::connect(
});
}
-BSONObj AsyncDBClient::_buildHelloRequest(const std::string& appName,
- executor::NetworkConnectionHook* hook) {
+BSONObj AsyncDBClient::_buildIsMasterRequest(const std::string& appName,
+ executor::NetworkConnectionHook* hook) {
BSONObjBuilder bob;
- bob.append("hello", 1);
+ bob.append("isMaster", 1);
const auto versionString = VersionInfoInterface::instance().version();
ClientMetadata::serialize(appName, versionString, &bob);
if (getTestCommandsEnabled()) {
- // Only include the host:port of this process in the "hello" command request if test
+ // Only include the host:port of this process in the isMaster command request if test
// commands are enabled. mongobridge uses this field to identify the process opening a
// connection to it.
StringBuilder sb;
@@ -98,16 +98,16 @@ BSONObj AsyncDBClient::_buildHelloRequest(const std::string& appName,
}
if (hook) {
- return hook->augmentHelloRequest(remote(), bob.obj());
+ return hook->augmentIsMasterRequest(remote(), bob.obj());
} else {
return bob.obj();
}
}
-void AsyncDBClient::_parseHelloResponse(BSONObj request,
- const std::unique_ptr<rpc::ReplyInterface>& response) {
+void AsyncDBClient::_parseIsMasterResponse(BSONObj request,
+ const std::unique_ptr<rpc::ReplyInterface>& response) {
uassert(50786,
- "Expected OP_MSG response to 'hello'",
+ "Expected OP_MSG response to isMaster",
response->getProtocol() == rpc::Protocol::kOpMsg);
auto wireSpec = WireSpec::instance().get();
auto responseBody = response->getCommandReply();
@@ -206,7 +206,7 @@ Future<bool> AsyncDBClient::completeSpeculativeAuth(std::shared_ptr<SaslClientSe
if (speculativeAuthType == auth::SpeculativeAuthType::kNone) {
return Status(ErrorCodes::BadValue,
- str::stream() << "Received unexpected hello."
+ str::stream() << "Received unexpected isMaster."
<< auth::kSpeculativeAuthenticate << " reply");
}
@@ -232,7 +232,7 @@ Future<bool> AsyncDBClient::completeSpeculativeAuth(std::shared_ptr<SaslClientSe
Future<void> AsyncDBClient::initWireVersion(const std::string& appName,
executor::NetworkConnectionHook* const hook) {
- auto requestObj = _buildHelloRequest(appName, hook);
+ auto requestObj = _buildIsMasterRequest(appName, hook);
auto opMsgRequest = OpMsgRequest::fromDBAndBody("admin", requestObj);
auto msgId = nextMessageId();
@@ -240,7 +240,7 @@ Future<void> AsyncDBClient::initWireVersion(const std::string& appName,
.then([msgId, this]() { return _waitForResponse(msgId); })
.then([this, requestObj, hook, timer = Timer{}](Message response) {
auto cmdReply = rpc::makeReply(&response);
- _parseHelloResponse(requestObj, cmdReply);
+ _parseIsMasterResponse(requestObj, cmdReply);
if (hook) {
executor::RemoteCommandResponse cmdResp(*cmdReply, timer.elapsed());
uassertStatusOK(hook->validateHost(_peer, requestObj, std::move(cmdResp)));