summaryrefslogtreecommitdiff
path: root/src/mongo/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/client')
-rw-r--r--src/mongo/client/async_client.cpp5
-rw-r--r--src/mongo/client/authenticate.cpp4
-rw-r--r--src/mongo/client/connection_string_connect.cpp17
-rw-r--r--src/mongo/client/connpool.cpp90
-rw-r--r--src/mongo/client/dbclient_base.cpp10
-rw-r--r--src/mongo/client/dbclient_connection.cpp58
-rw-r--r--src/mongo/client/dbclient_cursor.cpp5
-rw-r--r--src/mongo/client/dbclient_rs.cpp171
-rw-r--r--src/mongo/client/mongo_uri_test.cpp28
-rw-r--r--src/mongo/client/replica_set_monitor_manager.cpp7
-rw-r--r--src/mongo/client/sdam/topology_manager.cpp4
-rw-r--r--src/mongo/client/server_is_master_monitor.cpp57
-rw-r--r--src/mongo/client/streamable_replica_set_monitor.cpp28
-rw-r--r--src/mongo/client/streamable_replica_set_monitor_error_handler.cpp2
-rw-r--r--src/mongo/client/streamable_replica_set_monitor_query_processor.cpp4
15 files changed, 269 insertions, 221 deletions
diff --git a/src/mongo/client/async_client.cpp b/src/mongo/client/async_client.cpp
index f25830de073..2f65ec84a73 100644
--- a/src/mongo/client/async_client.cpp
+++ b/src/mongo/client/async_client.cpp
@@ -112,8 +112,9 @@ void AsyncDBClient::_parseIsMasterResponse(BSONObj request,
rpc::validateWireVersion(WireSpec::instance().outgoing, protocolSet.version);
if (!validateStatus.isOK()) {
LOGV2_WARNING(23741,
- "remote host has incompatible wire version: {validateStatus}",
- "validateStatus"_attr = validateStatus);
+ "Remote host has incompatible wire version: {error}",
+ "Remote host has incompatible wire version",
+ "error"_attr = validateStatus);
uasserted(validateStatus.code(),
str::stream() << "remote host has incompatible wire version: "
<< validateStatus.reason());
diff --git a/src/mongo/client/authenticate.cpp b/src/mongo/client/authenticate.cpp
index 8d4a2dc05ab..b073821bcc9 100644
--- a/src/mongo/client/authenticate.cpp
+++ b/src/mongo/client/authenticate.cpp
@@ -151,8 +151,8 @@ Future<void> authenticateClient(const BSONObj& params,
if (serverGlobalParams.transitionToAuth && !ErrorCodes::isNetworkError(status)) {
// If auth failed in transitionToAuth, just pretend it succeeded.
LOGV2(20108,
- "Failed to authenticate in transitionToAuth, falling back to no "
- "authentication.");
+ "Failed to authenticate in transitionToAuth, "
+ "falling back to no authentication");
return Status::OK();
}
diff --git a/src/mongo/client/connection_string_connect.cpp b/src/mongo/client/connection_string_connect.cpp
index 935888d3e4a..408e018f4b8 100644
--- a/src/mongo/client/connection_string_connect.cpp
+++ b/src/mongo/client/connection_string_connect.cpp
@@ -61,12 +61,15 @@ std::unique_ptr<DBClientBase> ConnectionString::connect(StringData applicationNa
auto c = std::make_unique<DBClientConnection>(true, 0, newURI);
c->setSoTimeout(socketTimeout);
- LOGV2_DEBUG(
- 20109, 1, "creating new connection to:{server}", "server"_attr = server);
+ LOGV2_DEBUG(20109,
+ 1,
+ "Creating new connection to: {hostAndPort}",
+ "Creating new connection",
+ "hostAndPort"_attr = server);
if (!c->connect(server, applicationName, errmsg)) {
continue;
}
- LOGV2_DEBUG(20110, 1, "connected connection!");
+ LOGV2_DEBUG(20110, 1, "Connected connection!");
return std::move(c);
}
return nullptr;
@@ -98,10 +101,10 @@ std::unique_ptr<DBClientBase> ConnectionString::connect(StringData applicationNa
auto replacementConn = _connectHook->connect(*this, errmsg, socketTimeout);
LOGV2(20111,
- "replacing connection to {this} with "
- "{replacementConn_replacementConn_getServerAddress_empty}",
- "this"_attr = this->toString(),
- "replacementConn_replacementConn_getServerAddress_empty"_attr =
+ "Replacing connection to {oldConnString} with {newConnString}",
+ "Replacing connection string",
+ "oldConnString"_attr = this->toString(),
+ "newConnString"_attr =
(replacementConn ? replacementConn->getServerAddress() : "(empty)"));
return replacementConn;
diff --git a/src/mongo/client/connpool.cpp b/src/mongo/client/connpool.cpp
index bdfae49529c..941ca71fdd7 100644
--- a/src/mongo/client/connpool.cpp
+++ b/src/mongo/client/connpool.cpp
@@ -62,6 +62,10 @@ namespace mongo {
namespace {
const int kDefaultIdleTimeout = std::numeric_limits<int>::max();
const int kDefaultMaxInUse = std::numeric_limits<int>::max();
+
+auto makeDuration(double secs) {
+ return Milliseconds(static_cast<Milliseconds::rep>(1000 * secs));
+}
} // namespace
using std::endl;
@@ -91,10 +95,11 @@ PoolForHost::~PoolForHost() {
void PoolForHost::clear() {
if (!_parentDestroyed) {
LOGV2(24124,
- "Dropping all pooled connections to {hostName}(with timeout of {socketTimeoutSecs} "
- "seconds)",
- "hostName"_attr = _hostName,
- "socketTimeoutSecs"_attr = _socketTimeoutSecs);
+ "Dropping all pooled connections to {connString} "
+ "(with timeout of {timeoutSecs} seconds)",
+ "Dropping all pooled connections to a host",
+ "connString"_attr = _hostName,
+ "socketTimeout"_attr = makeDuration(_socketTimeoutSecs));
}
_pool = decltype(_pool){};
@@ -114,23 +119,24 @@ auto PoolForHost::done(DBConnectionPool* pool, DBClientBase* c) -> ConnectionHea
bool isBroken = c->getSockCreationMicroSec() < _minValidCreationTimeMicroSec;
if (isFailed || isBroken) {
_badConns++;
- LOGV2(
- 24125,
- "Ending connection to host {hostName}(with timeout of {socketTimeoutSecs} seconds) due "
- "to bad connection status; {openConnections} connections to that host remain open",
- "hostName"_attr = _hostName,
- "socketTimeoutSecs"_attr = _socketTimeoutSecs,
- "openConnections"_attr = openConnections());
+ LOGV2(24125,
+ "Ending connection to {connString} (with timeout of {socketTimeout}) "
+ "due to bad connection status; {numOpenConns} connections to that host remain open",
+ "Ending connection to a host due to a bad connection status",
+ "connString"_attr = _hostName,
+ "socketTimeout"_attr = makeDuration(_socketTimeoutSecs),
+ "numOpenConns"_attr = openConnections());
return ConnectionHealth::kFailed;
} else if (_maxPoolSize >= 0 && static_cast<int>(_pool.size()) >= _maxPoolSize) {
// We have a pool size that we need to enforce
LOGV2(24126,
- "Ending idle connection to host {hostName}(with timeout of {socketTimeoutSecs} "
- "seconds) because the pool meets constraints; {openConnections} connections to that "
- "host remain open",
- "hostName"_attr = _hostName,
- "socketTimeoutSecs"_attr = _socketTimeoutSecs,
- "openConnections"_attr = openConnections());
+ "Ending idle connection to {connString} (with timeout of {socketTimeout}) "
+ "because its pool meets constraints; "
+ "{numOpenConns} connections to that host remain open",
+ "Ending idle connection to a host because its pool mees constraints",
+ "connString"_attr = _hostName,
+ "socketTimeout"_attr = makeDuration(_socketTimeoutSecs),
+ "numOpenConns"_attr = openConnections());
return ConnectionHealth::kTooMany;
}
@@ -144,11 +150,13 @@ void PoolForHost::reportBadConnectionAt(uint64_t microSec) {
microSec > _minValidCreationTimeMicroSec) {
_minValidCreationTimeMicroSec = microSec;
LOGV2(24127,
- "Detected bad connection created at {minValidCreationTimeMicroSec} microSec, "
- "clearing pool for {hostName} of {openConnections} connections",
- "minValidCreationTimeMicroSec"_attr = _minValidCreationTimeMicroSec,
- "hostName"_attr = _hostName,
- "openConnections"_attr = openConnections());
+ "Detected bad connection created at {currentTime}, "
+ "clearing pool for {connString} of {numOpenConns} connections",
+ "Detected bad connection, clearing pool for host",
+ "currentTime"_attr =
+ Microseconds(static_cast<Microseconds::rep>(_minValidCreationTimeMicroSec)),
+ "connString"_attr = _hostName,
+ "numOpenConns"_attr = openConnections());
clear();
}
}
@@ -280,9 +288,10 @@ public:
if (p.openConnections() >= _this->_maxInUse) {
LOGV2(20112,
- "Too many in-use connections; waiting until there are fewer than "
- "{this_maxInUse}",
- "this_maxInUse"_attr = _this->_maxInUse);
+ "Too many in-use connections; "
+ "waiting until there are fewer than {maxInUseConns}",
+ "Too many in-use connections; waiting until there are fewer than maximum",
+ "maxInUseConns"_attr = _this->_maxInUse);
p.waitForFreeConnection(timeout, lk);
} else {
// Drop the lock here, so we can connect without holding it.
@@ -367,12 +376,13 @@ DBClientBase* DBConnectionPool::_finishCreate(const string& ident,
}
LOGV2(20113,
- "Successfully connected to {ident} ({openConnections_ident_socketTimeout} connections "
- "now open to {ident2} with a {socketTimeout} second timeout)",
- "ident"_attr = ident,
- "openConnections_ident_socketTimeout"_attr = openConnections(ident, socketTimeout),
- "ident2"_attr = ident,
- "socketTimeout"_attr = socketTimeout);
+ "Successfully connected to {connString} "
+ "({numOpenConns} connections now open to that host "
+ "with a {socketTimeoutSecs} second timeout)",
+ "Successfully connected to host",
+ "connString"_attr = ident,
+ "numOpenConns"_attr = openConnections(ident, socketTimeout),
+ "socketTimeoutSecs"_attr = socketTimeout);
return conn;
}
@@ -490,7 +500,11 @@ void DBConnectionPool::flush() {
void DBConnectionPool::clear() {
stdx::lock_guard<Latch> L(_mutex);
- LOGV2_DEBUG(20114, 2, "Removing connections on all pools owned by {name}", "name"_attr = _name);
+ LOGV2_DEBUG(20114,
+ 2,
+ "Removing connections on all pools owned by {poolName}",
+ "Removing all connectionns associated with this set of pools",
+ "poolName"_attr = _name);
for (PoolMap::iterator iter = _pools.begin(); iter != _pools.end(); ++iter) {
iter->second.clear();
}
@@ -498,8 +512,11 @@ void DBConnectionPool::clear() {
void DBConnectionPool::removeHost(const string& host) {
stdx::lock_guard<Latch> L(_mutex);
- LOGV2_DEBUG(
- 20115, 2, "Removing connections from all pools for host: {host}", "host"_attr = host);
+ LOGV2_DEBUG(20115,
+ 2,
+ "Removing connections from all pools to {connString}",
+ "Removing connections from all pools to a host",
+ "connString"_attr = host);
for (PoolMap::iterator i = _pools.begin(); i != _pools.end(); ++i) {
const string& poolHost = i->first.ident;
if (!serverNameCompare()(host, poolHost) && !serverNameCompare()(poolHost, host)) {
@@ -701,8 +718,9 @@ ScopedDbConnection::~ScopedDbConnection() {
} else {
/* see done() comments above for why we log this line */
LOGV2(24128,
- "scoped connection to {conn_getServerAddress} not being returned to the pool",
- "conn_getServerAddress"_attr = _conn->getServerAddress());
+ "Scoped connection to {connString} not being returned to the pool",
+ "Scoped connection not being returned to the pool",
+ "connString"_attr = _conn->getServerAddress());
kill();
}
}
diff --git a/src/mongo/client/dbclient_base.cpp b/src/mongo/client/dbclient_base.cpp
index 8405348b843..dc7dd7cf310 100644
--- a/src/mongo/client/dbclient_base.cpp
+++ b/src/mongo/client/dbclient_base.cpp
@@ -501,11 +501,12 @@ Status DBClientBase::authenticateInternalUser() {
return status;
}
- if (serverGlobalParams.quiet.load()) {
+ if (!serverGlobalParams.quiet.load()) {
LOGV2(20117,
- "can't authenticate to {} as internal user, error: {status_reason}",
- ""_attr = toString(),
- "status_reason"_attr = status.reason());
+ "Can't authenticate to {connString} as internal user, error: {error}",
+ "Can't authenticate as internal user",
+ "connString"_attr = toString(),
+ "error"_attr = status);
}
return status;
@@ -999,6 +1000,7 @@ void DBClientBase::dropIndex(const string& ns,
LOGV2_DEBUG(20118,
logSeverityV1toV2(_logLevel).toInt(),
"dropIndex failed: {info}",
+ "dropIndex failed",
"info"_attr = info);
uassert(10007, "dropIndex failed", 0);
}
diff --git a/src/mongo/client/dbclient_connection.cpp b/src/mongo/client/dbclient_connection.cpp
index a5a6f3005ce..6f0940faf49 100644
--- a/src/mongo/client/dbclient_connection.cpp
+++ b/src/mongo/client/dbclient_connection.cpp
@@ -342,8 +342,9 @@ Status DBClientConnection::connect(const HostAndPort& serverAddress, StringData
rpc::validateWireVersion(WireSpec::instance().outgoing, swProtocolSet.getValue().version);
if (!validateStatus.isOK()) {
LOGV2_WARNING(20126,
- "remote host has incompatible wire version: {validateStatus}",
- "validateStatus"_attr = validateStatus);
+ "Remote host has incompatible wire version: {error}",
+ "Remote host has incompatible wire version",
+ "error"_attr = validateStatus);
return validateStatus;
}
@@ -426,7 +427,11 @@ Status DBClientConnection::connectSocketOnly(const HostAndPort& serverAddress) {
_lastConnectivityCheck = Date_t::now();
_session->setTimeout(_socketTimeout);
_session->setTags(_tagMask);
- LOGV2_DEBUG(20119, 1, "connected to server {}", ""_attr = toString());
+ LOGV2_DEBUG(20119,
+ 1,
+ "Connected to host {connString}",
+ "Connected to host",
+ "connString"_attr = toString());
return Status::OK();
}
@@ -555,17 +560,19 @@ void DBClientConnection::_checkConnection() {
LOGV2_DEBUG(20120,
logSeverityV1toV2(_logLevel).toInt(),
- "trying reconnect to {}",
- ""_attr = toString());
+ "Trying to reconnect to {connString}",
+ "Trying to reconnnect",
+ "connString"_attr = toString());
string errmsg;
auto connectStatus = connect(_serverAddress, _applicationName);
if (!connectStatus.isOK()) {
_markFailed(kSetFlag);
LOGV2_DEBUG(20121,
logSeverityV1toV2(_logLevel).toInt(),
- "reconnect {} failed {errmsg}",
- ""_attr = toString(),
- "errmsg"_attr = errmsg);
+ "Reconnect attempt to {connString} failed: {reason}",
+ "Reconnect attempt failed",
+ "connString"_attr = toString(),
+ "error"_attr = errmsg);
if (connectStatus == ErrorCodes::IncompatibleCatalogManager) {
uassertStatusOK(connectStatus); // Will always throw
} else {
@@ -573,8 +580,11 @@ void DBClientConnection::_checkConnection() {
}
}
- LOGV2_DEBUG(
- 20122, logSeverityV1toV2(_logLevel).toInt(), "reconnect {} ok", ""_attr = toString());
+ LOGV2_DEBUG(20122,
+ logSeverityV1toV2(_logLevel).toInt(),
+ "Reconnected to {connString}",
+ "Reconnected",
+ "connString"_attr = toString());
if (_internalAuthOnReconnect) {
uassertStatusOK(authenticateInternalUser());
} else {
@@ -584,14 +594,11 @@ void DBClientConnection::_checkConnection() {
} catch (ExceptionFor<ErrorCodes::AuthenticationFailed>& ex) {
LOGV2_DEBUG(20123,
logSeverityV1toV2(_logLevel).toInt(),
- "reconnect: auth failed "
- "{kv_second_auth_getSaslCommandUserDBFieldName}{kv_second_auth_"
- "getSaslCommandUserFieldName} {ex_what}",
- "kv_second_auth_getSaslCommandUserDBFieldName"_attr =
- kv.second[auth::getSaslCommandUserDBFieldName()],
- "kv_second_auth_getSaslCommandUserFieldName"_attr =
- kv.second[auth::getSaslCommandUserFieldName()],
- "ex_what"_attr = ex.what());
+ "Reconnect: auth failed for on {db} using {user}: {reason}",
+ "Reconnect: auth failed",
+ "db"_attr = kv.second[auth::getSaslCommandUserDBFieldName()],
+ "user"_attr = kv.second[auth::getSaslCommandUserFieldName()],
+ "error"_attr = ex.what());
}
}
}
@@ -747,9 +754,10 @@ bool DBClientConnection::call(Message& toSend,
auto sinkStatus = _session->sinkMessage(swm.getValue());
if (!sinkStatus.isOK()) {
LOGV2(20124,
- "DBClientConnection failed to send message to {getServerAddress} - {sinkStatus}",
- "getServerAddress"_attr = getServerAddress(),
- "sinkStatus"_attr = redact(sinkStatus));
+ "DBClientConnection failed to send message to {connString}: {error}",
+ "DBClientConnection failed to send message",
+ "connString"_attr = getServerAddress(),
+ "error"_attr = redact(sinkStatus));
return maybeThrow(sinkStatus);
}
@@ -758,10 +766,10 @@ bool DBClientConnection::call(Message& toSend,
response = std::move(swm.getValue());
} else {
LOGV2(20125,
- "DBClientConnection failed to receive message from {getServerAddress} - "
- "{swm_getStatus}",
- "getServerAddress"_attr = getServerAddress(),
- "swm_getStatus"_attr = redact(swm.getStatus()));
+ "DBClientConnection failed to receive message from {connString}: {error}",
+ "DBClientConnection failed to receive message",
+ "connString"_attr = getServerAddress(),
+ "error"_attr = redact(swm.getStatus()));
return maybeThrow(swm.getStatus());
}
diff --git a/src/mongo/client/dbclient_cursor.cpp b/src/mongo/client/dbclient_cursor.cpp
index 60034c05514..c3296fe49ad 100644
--- a/src/mongo/client/dbclient_cursor.cpp
+++ b/src/mongo/client/dbclient_cursor.cpp
@@ -242,8 +242,9 @@ bool DBClientCursor::initLazyFinish(bool& retry) {
if (!recvStatus.isOK() || reply.empty()) {
if (!recvStatus.isOK())
LOGV2(20129,
- "DBClientCursor::init lazy say() failed: {recvStatus}",
- "recvStatus"_attr = redact(recvStatus));
+ "DBClientCursor::init lazy say() failed: {error}",
+ "DBClientCursor::init lazy say() failed",
+ "error"_attr = redact(recvStatus));
if (reply.empty())
LOGV2(20130, "DBClientCursor::init message from say() was empty");
diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp
index d7744d2c841..e37232c3750 100644
--- a/src/mongo/client/dbclient_rs.cpp
+++ b/src/mongo/client/dbclient_rs.cpp
@@ -159,9 +159,11 @@ ReplicaSetMonitorPtr DBClientReplicaSet::_getMonitor() {
string DBClientReplicaSet::getServerAddress() const {
if (!_rsm) {
LOGV2_WARNING(20147,
- "Trying to get server address for DBClientReplicaSet, but no "
- "ReplicaSetMonitor exists for {setName}",
- "setName"_attr = _setName);
+ "Trying to get server address for DBClientReplicaSet, "
+ "but no ReplicaSetMonitor exists for {replicaSet}",
+ "Trying to get server address for DBClientReplicaSet, "
+ "but no ReplicaSetMonitor exists",
+ "replicaSet"_attr = _setName);
return str::stream() << _setName << "/";
}
return _rsm->getServerAddress();
@@ -360,9 +362,10 @@ void DBClientReplicaSet::_authConnection(DBClientConnection* conn) {
auto status = conn->authenticateInternalUser();
if (!status.isOK()) {
LOGV2_WARNING(20148,
- "cached auth failed for set {setName}: {status}",
- "setName"_attr = _setName,
- "status"_attr = status);
+ "Cached auth failed for set {replicaSet}: {error}",
+ "Cached auth failed",
+ "replicaSet"_attr = _setName,
+ "error"_attr = status);
}
return;
}
@@ -372,14 +375,11 @@ void DBClientReplicaSet::_authConnection(DBClientConnection* conn) {
conn->auth(i->second);
} catch (const AssertionException&) {
LOGV2_WARNING(20149,
- "cached auth failed for set: {setName} db: "
- "{i_second_saslCommandUserDBFieldName_str} user: "
- "{i_second_saslCommandUserFieldName_str}",
- "setName"_attr = _setName,
- "i_second_saslCommandUserDBFieldName_str"_attr =
- i->second[saslCommandUserDBFieldName].str(),
- "i_second_saslCommandUserFieldName_str"_attr =
- i->second[saslCommandUserFieldName].str());
+ "Cached auth failed for set: {replicaSet} db: {db} user: {user}",
+ "Cached auth failed",
+ "replicaSet"_attr = _setName,
+ "db"_attr = i->second[saslCommandUserDBFieldName].str(),
+ "user"_attr = i->second[saslCommandUserFieldName].str());
}
}
}
@@ -392,10 +392,11 @@ void DBClientReplicaSet::logoutAll(DBClientConnection* conn) {
conn->logout(i->first, response);
} catch (const AssertionException& ex) {
LOGV2_WARNING(20150,
- "Failed to logout: {conn_getServerAddress} on db: {i_first}{causedBy_ex}",
- "conn_getServerAddress"_attr = conn->getServerAddress(),
- "i_first"_attr = i->first,
- "causedBy_ex"_attr = causedBy(redact(ex)));
+ "Failed to logout: {connString} on db: {db} with error: {error}",
+ "Failed to logout",
+ "connString"_attr = conn->getServerAddress(),
+ "db"_attr = i->first,
+ "error"_attr = redact(ex));
}
}
}
@@ -431,8 +432,9 @@ Status DBClientReplicaSet::_runAuthLoop(Authenticate authCb) {
LOGV2_DEBUG(20132,
3,
- "dbclient_rs authentication of {getMonitor_getName}",
- "getMonitor_getName"_attr = _getMonitor()->getName());
+ "dbclient_rs attempting authentication of {replicaSet}",
+ "dbclient_rs attempting authentication",
+ "replicaSet"_attr = _getMonitor()->getName());
// NOTE that we retry MAX_RETRY + 1 times, since we're always primary preferred we don't
// fallback to the primary.
@@ -565,15 +567,15 @@ unique_ptr<DBClientCursor> DBClientReplicaSet::query(const NamespaceStringOrUUID
if (_isSecondaryQuery(ns, query.obj, *readPref)) {
LOGV2_DEBUG(20133,
3,
- "dbclient_rs query using secondary or tagged node selection in "
- "{getMonitor_getName}, read pref is {readPref} (primary : "
- "{master_get_nullptr_master_getServerAddress_not_cached}, lastTagged : "
- "{lastSlaveOkConn_get_nullptr_lastSlaveOkConn_getServerAddress_not_cached})",
- "getMonitor_getName"_attr = _getMonitor()->getName(),
+ "dbclient_rs query using secondary or tagged node selection in {replicaSet}, "
+ "read pref is {readPref} "
+ "(primary : {primary}, lastTagged : {lastTagged})",
+ "dbclient_rs query using secondary or tagged node selection",
+ "replicaSet"_attr = _getMonitor()->getName(),
"readPref"_attr = readPref->toString(),
- "master_get_nullptr_master_getServerAddress_not_cached"_attr =
+ "primary"_attr =
(_master.get() != nullptr ? _master->getServerAddress() : "[not cached]"),
- "lastSlaveOkConn_get_nullptr_lastSlaveOkConn_getServerAddress_not_cached"_attr =
+ "lastTagged"_attr =
(_lastSlaveOkConn.get() != nullptr ? _lastSlaveOkConn->getServerAddress()
: "[not cached]"));
@@ -616,8 +618,9 @@ unique_ptr<DBClientCursor> DBClientReplicaSet::query(const NamespaceStringOrUUID
LOGV2_DEBUG(20134,
3,
- "dbclient_rs query to primary node in {getMonitor_getName}",
- "getMonitor_getName"_attr = _getMonitor()->getName());
+ "dbclient_rs query to primary node in {replicaSet}",
+ "dbclient_rs query to primary node",
+ "replicaSet"_attr = _getMonitor()->getName());
return checkMaster()->query(nsOrUuid,
query,
@@ -638,15 +641,15 @@ BSONObj DBClientReplicaSet::findOne(const string& ns,
if (_isSecondaryQuery(ns, query.obj, *readPref)) {
LOGV2_DEBUG(20135,
3,
- "dbclient_rs findOne using secondary or tagged node selection in "
- "{getMonitor_getName}, read pref is {readPref} (primary : "
- "{master_get_nullptr_master_getServerAddress_not_cached}, lastTagged : "
- "{lastSlaveOkConn_get_nullptr_lastSlaveOkConn_getServerAddress_not_cached})",
- "getMonitor_getName"_attr = _getMonitor()->getName(),
+ "dbclient_rs findOne using secondary or tagged node selection in {replicaSet}, "
+ "read pref is {readPref} "
+ "(primary : {primary}, lastTagged : {lastTagged})",
+ "dbclient_rs findOne using secondary or tagged node selection",
+ "replicaSet"_attr = _getMonitor()->getName(),
"readPref"_attr = readPref->toString(),
- "master_get_nullptr_master_getServerAddress_not_cached"_attr =
+ "primary"_attr =
(_master.get() != nullptr ? _master->getServerAddress() : "[not cached]"),
- "lastSlaveOkConn_get_nullptr_lastSlaveOkConn_getServerAddress_not_cached"_attr =
+ "secondaryHostNamme"_attr =
(_lastSlaveOkConn.get() != nullptr ? _lastSlaveOkConn->getServerAddress()
: "[not cached]"));
@@ -680,8 +683,9 @@ BSONObj DBClientReplicaSet::findOne(const string& ns,
LOGV2_DEBUG(20136,
3,
- "dbclient_rs findOne to primary node in {getMonitor_getName}",
- "getMonitor_getName"_attr = _getMonitor()->getName());
+ "dbclient_rs findOne to primary node in {replicaSet}",
+ "dbclient_rs findOne to primary node",
+ "replicaSet"_attr = _getMonitor()->getName());
return checkMaster()->findOne(ns, query, fieldsToReturn, queryOptions, readConcernObj);
}
@@ -743,8 +747,9 @@ DBClientConnection* DBClientReplicaSet::selectNodeUsingTags(
if (checkLastHost(readPref.get())) {
LOGV2_DEBUG(20137,
3,
- "dbclient_rs selecting compatible last used node {lastSlaveOkHost}",
- "lastSlaveOkHost"_attr = _lastSlaveOkHost);
+ "dbclient_rs selecting compatible last used node {lastTagged}",
+ "dbclient_rs selecting compatible last used node",
+ "lastTagged"_attr = _lastSlaveOkHost);
return _lastSlaveOkConn.get();
}
@@ -755,9 +760,9 @@ DBClientConnection* DBClientReplicaSet::selectNodeUsingTags(
if (!selectedNodeStatus.isOK()) {
LOGV2_DEBUG(20138,
3,
- "dbclient_rs no compatible node found{causedBy_selectedNodeStatus_getStatus}",
- "causedBy_selectedNodeStatus_getStatus"_attr =
- causedBy(redact(selectedNodeStatus.getStatus())));
+ "dbclient_rs no compatible node found: {error}",
+ "dbclient_rs no compatible node found",
+ "error"_attr = redact(selectedNodeStatus.getStatus()));
return nullptr;
}
@@ -779,8 +784,9 @@ DBClientConnection* DBClientReplicaSet::selectNodeUsingTags(
LOGV2_DEBUG(20139,
3,
- "dbclient_rs selecting primary node {selectedNode}",
- "selectedNode"_attr = selectedNode);
+ "dbclient_rs selecting primary node {connString}",
+ "dbclient_rs selecting primary node",
+ "connString"_attr = selectedNode);
_lastSlaveOkConn = _master;
@@ -818,8 +824,9 @@ DBClientConnection* DBClientReplicaSet::selectNodeUsingTags(
LOGV2_DEBUG(20140,
3,
- "dbclient_rs selecting node {lastSlaveOkHost}",
- "lastSlaveOkHost"_attr = _lastSlaveOkHost);
+ "dbclient_rs selecting node {connString}",
+ "dbclient_rs selecting node",
+ "connString"_attr = _lastSlaveOkHost);
return _lastSlaveOkConn.get();
}
@@ -837,20 +844,19 @@ void DBClientReplicaSet::say(Message& toSend, bool isRetry, string* actualServer
shared_ptr<ReadPreferenceSetting> readPref(_extractReadPref(qm.query, qm.queryOptions));
if (_isSecondaryQuery(qm.ns, qm.query, *readPref)) {
- LOGV2_DEBUG(
- 20141,
- 3,
- "dbclient_rs say using secondary or tagged node selection in {getMonitor_getName}, "
- "read pref is {readPref} (primary : "
- "{master_get_nullptr_master_getServerAddress_not_cached}, lastTagged : "
- "{lastSlaveOkConn_get_nullptr_lastSlaveOkConn_getServerAddress_not_cached})",
- "getMonitor_getName"_attr = _getMonitor()->getName(),
- "readPref"_attr = readPref->toString(),
- "master_get_nullptr_master_getServerAddress_not_cached"_attr =
- (_master.get() != nullptr ? _master->getServerAddress() : "[not cached]"),
- "lastSlaveOkConn_get_nullptr_lastSlaveOkConn_getServerAddress_not_cached"_attr =
- (_lastSlaveOkConn.get() != nullptr ? _lastSlaveOkConn->getServerAddress()
- : "[not cached]"));
+ LOGV2_DEBUG(20141,
+ 3,
+ "dbclient_rs say using secondary or tagged node selection in {replicaSet}, "
+ "read pref is {readPref} "
+ "(primary : {primary}, lastTagged : {lastTagged})",
+ "dbclient_rs say using secondary or tagged node selection",
+ "replicaSet"_attr = _getMonitor()->getName(),
+ "readPref"_attr = readPref->toString(),
+ "primary"_attr = (_master.get() != nullptr ? _master->getServerAddress()
+ : "[not cached]"),
+ "lastTagged"_attr = (_lastSlaveOkConn.get() != nullptr
+ ? _lastSlaveOkConn->getServerAddress()
+ : "[not cached]"));
string lastNodeErrMsg;
@@ -897,8 +903,9 @@ void DBClientReplicaSet::say(Message& toSend, bool isRetry, string* actualServer
LOGV2_DEBUG(20142,
3,
- "dbclient_rs say to primary node in {getMonitor_getName}",
- "getMonitor_getName"_attr = _getMonitor()->getName());
+ "dbclient_rs say to primary node in {replicaSet}",
+ "dbclient_rs say to primary node",
+ "replicaSet"_attr = _getMonitor()->getName());
DBClientConnection* master = checkMaster();
if (actualServer)
@@ -921,9 +928,10 @@ Status DBClientReplicaSet::recv(Message& m, int lastRequestId) {
return _lazyState._lastClient->recv(m, lastRequestId);
} catch (DBException& e) {
LOGV2(20143,
- "could not receive data from {lazyState_lastClient}{causedBy_e}",
- "lazyState_lastClient"_attr = _lazyState._lastClient->toString(),
- "causedBy_e"_attr = causedBy(redact(e)));
+ "Could not receive data from {connString}: {error}",
+ "Could not receive data",
+ "connString"_attr = _lazyState._lastClient->toString(),
+ "error"_attr = redact(e));
return e.toStatus();
}
}
@@ -974,10 +982,11 @@ void DBClientReplicaSet::checkResponse(const std::vector<BSONObj>& batch,
isntMaster();
} else {
LOGV2_WARNING(20151,
- "passed {dataObj} but last rs client {lazyState_lastClient} is not "
- "master or secondary",
+ "Data {dataObj} is invalid because last rs client {connString} is "
+ "not master or secondary",
+ "Data is invalid because last rs client is not master or secondary",
"dataObj"_attr = redact(dataObj),
- "lazyState_lastClient"_attr = _lazyState._lastClient->toString());
+ "connString"_attr = _lazyState._lastClient->toString());
}
if (_lazyState._retries < static_cast<int>(MAX_RETRY)) {
@@ -985,8 +994,9 @@ void DBClientReplicaSet::checkResponse(const std::vector<BSONObj>& batch,
*retry = true;
} else {
LOGV2(20144,
- "too many retries ({lazyState_retries}), could not get data from replica set",
- "lazyState_retries"_attr = _lazyState._retries);
+ "Too many retries ({numRetries}), could not get data from replica set",
+ "Too many retries, could not get data from replica set",
+ "numRetries"_attr = _lazyState._retries);
}
}
} else if (_lazyState._lastOp == dbQuery) {
@@ -1085,15 +1095,15 @@ bool DBClientReplicaSet::call(Message& toSend,
LOGV2_DEBUG(
20145,
3,
- "dbclient_rs call using secondary or tagged node selection in "
- "{getMonitor_getName}, read pref is {readPref} (primary : "
- "{master_get_nullptr_master_getServerAddress_not_cached}, lastTagged : "
- "{lastSlaveOkConn_get_nullptr_lastSlaveOkConn_getServerAddress_not_cached})",
- "getMonitor_getName"_attr = _getMonitor()->getName(),
+ "dbclient_rs call using secondary or tagged node selection in {replicaSet}, "
+ "read pref is {readPref} "
+ "(primary : {primary}, lastTagged : {lastTagged})",
+ "dbclient_rs call using secondary or tagged node selection",
+ "replicaSet"_attr = _getMonitor()->getName(),
"readPref"_attr = readPref->toString(),
- "master_get_nullptr_master_getServerAddress_not_cached"_attr =
+ "primary"_attr =
(_master.get() != nullptr ? _master->getServerAddress() : "[not cached]"),
- "lastSlaveOkConn_get_nullptr_lastSlaveOkConn_getServerAddress_not_cached"_attr =
+ "lastTagged"_attr =
(_lastSlaveOkConn.get() != nullptr ? _lastSlaveOkConn->getServerAddress()
: "[not cached]"));
@@ -1127,8 +1137,9 @@ bool DBClientReplicaSet::call(Message& toSend,
LOGV2_DEBUG(20146,
3,
- "dbclient_rs call to primary node in {getMonitor_getName}",
- "getMonitor_getName"_attr = _getMonitor()->getName());
+ "dbclient_rs call to primary node in {replicaSet}",
+ "dbclient_rs call to primary node",
+ "replicaSet"_attr = _getMonitor()->getName());
DBClientConnection* m = checkMaster();
if (actualServer)
diff --git a/src/mongo/client/mongo_uri_test.cpp b/src/mongo/client/mongo_uri_test.cpp
index bada38c3df5..d53ca990602 100644
--- a/src/mongo/client/mongo_uri_test.cpp
+++ b/src/mongo/client/mongo_uri_test.cpp
@@ -87,16 +87,15 @@ void compareOptions(size_t lineNumber,
for (std::size_t i = 0; i < std::min(options.size(), expectedOptions.size()); ++i) {
if (options[i] != expectedOptions[i]) {
- LOGV2(
- 20152,
- "Option: \"tolower({options_i_first_original})={options_i_second}\" doesn't equal: "
- "\"tolower({expectedOptions_i_first_original})={expectedOptions_i_second}\" data "
- "on line: {lineNumber}",
- "options_i_first_original"_attr = options[i].first.original(),
- "options_i_second"_attr = options[i].second,
- "expectedOptions_i_first_original"_attr = expectedOptions[i].first.original(),
- "expectedOptions_i_second"_attr = expectedOptions[i].second,
- "lineNumber"_attr = lineNumber);
+ LOGV2(20152,
+ "Option: \"tolower({key})={value}\" doesn't equal: "
+ "\"tolower({expectedKey})={expectedValue}\" data on line: {lineNumber}",
+ "Option key-value pair doesn't equal expected pair",
+ "key"_attr = options[i].first.original(),
+ "value"_attr = options[i].second,
+ "expectedKey"_attr = expectedOptions[i].first.original(),
+ "expectedValue"_attr = expectedOptions[i].second,
+ "lineNumber"_attr = lineNumber);
std::cerr << "Failing URI: \"" << uri << "\""
<< " data on line: " << lineNumber << std::endl;
ASSERT(false);
@@ -602,7 +601,7 @@ std::string returnStringFromElementOrNull(BSONElement element) {
// Helper method to take a valid test case, parse() it, and assure the output is correct
void testValidURIFormat(URITestCase testCase) {
- LOGV2(20153, "Testing URI: {testCase_URI}", "testCase_URI"_attr = testCase.URI);
+ LOGV2(20153, "Testing URI: {mongoUri}", "Testing URI", "mongoUri"_attr = testCase.URI);
std::string errMsg;
const auto cs_status = MongoURI::parse(testCase.URI);
ASSERT_OK(cs_status);
@@ -630,7 +629,7 @@ TEST(MongoURI, InvalidURIs) {
for (size_t i = 0; i != numCases; ++i) {
const InvalidURITestCase testCase = invalidCases[i];
- LOGV2(20154, "Testing URI: {testCase_URI}", "testCase_URI"_attr = testCase.URI);
+ LOGV2(20154, "Testing URI: {mongoUri}", "Testing URI", "mongoUri"_attr = testCase.URI);
auto cs_status = MongoURI::parse(testCase.URI);
ASSERT_NOT_OK(cs_status);
if (testCase.code) {
@@ -712,7 +711,10 @@ TEST(MongoURI, specTests) {
if (!valid) {
// This uri string is invalid --> parse the uri and ensure it fails
const InvalidURITestCase testCase = InvalidURITestCase{uri};
- LOGV2(20155, "Testing URI: {testCase_URI}", "testCase_URI"_attr = testCase.URI);
+ LOGV2(20155,
+ "Testing URI: {mongoUri}",
+ "Testing URI",
+ "mongoUri"_attr = testCase.URI);
auto cs_status = MongoURI::parse(testCase.URI);
ASSERT_NOT_OK(cs_status);
} else {
diff --git a/src/mongo/client/replica_set_monitor_manager.cpp b/src/mongo/client/replica_set_monitor_manager.cpp
index 2391037fba9..828fa9b6c8f 100644
--- a/src/mongo/client/replica_set_monitor_manager.cpp
+++ b/src/mongo/client/replica_set_monitor_manager.cpp
@@ -100,7 +100,7 @@ Status ReplicaSetMonitorManagerNetworkConnectionHook::validateHost(
LOGV2_ERROR(4712101,
"An error occurred publishing a ReplicaSetMonitor handshake event",
"error"_attr = exception.toStatus(),
- "setName"_attr = monitor->getName(),
+ "replicaSet"_attr = monitor->getName(),
"handshakeStatus"_attr = isMasterReply.status);
return exception.toStatus();
}
@@ -235,8 +235,9 @@ void ReplicaSetMonitorManager::removeMonitor(StringData setName) {
monitor->drop();
}
_monitors.erase(it);
- LOGV2(
- 20187, "Removed ReplicaSetMonitor for replica set {setName}", "setName"_attr = setName);
+ LOGV2(20187,
+ "Removed ReplicaSetMonitor for replica set {replicaSet}",
+ "replicaSet"_attr = setName);
}
}
diff --git a/src/mongo/client/sdam/topology_manager.cpp b/src/mongo/client/sdam/topology_manager.cpp
index 74f8de94d27..389b5a8b1a9 100644
--- a/src/mongo/client/sdam/topology_manager.cpp
+++ b/src/mongo/client/sdam/topology_manager.cpp
@@ -147,9 +147,9 @@ void TopologyManager::onServerRTTUpdated(ServerAddress hostAndPort, IsMasterRTT
}
// otherwise, the server was removed from the topology. Nothing to do.
LOGV2(4333201,
- "Not updating RTT. Server {server} does not exist in {setName}",
+ "Not updating RTT. Server {server} does not exist in {replicaSet}",
"host"_attr = hostAndPort,
- "setName"_attr = getTopologyDescription()->getSetName());
+ "replicaSet"_attr = getTopologyDescription()->getSetName());
}
void TopologyManager::_publishTopologyDescriptionChanged(
diff --git a/src/mongo/client/server_is_master_monitor.cpp b/src/mongo/client/server_is_master_monitor.cpp
index eb211c3af97..eab24eddb7e 100644
--- a/src/mongo/client/server_is_master_monitor.cpp
+++ b/src/mongo/client/server_is_master_monitor.cpp
@@ -78,9 +78,9 @@ SingleServerIsMasterMonitor::SingleServerIsMasterMonitor(
_setUri(setUri) {
LOGV2_DEBUG(4333217,
kLogLevel + 1,
- "RSM {setName} monitoring {host}",
+ "RSM {replicaSet} monitoring {host}",
"host"_attr = host,
- "setName"_attr = _setUri.getSetName());
+ "replicaSet"_attr = _setUri.getSetName());
}
void SingleServerIsMasterMonitor::init() {
@@ -100,11 +100,12 @@ void SingleServerIsMasterMonitor::requestImmediateCheck() {
if (!_isExpedited) {
// save some log lines.
- LOGV2_DEBUG(4333227,
- kLogLevel,
- "RSM {setName} monitoring {host} in expedited mode until we detect a primary.",
- "host"_attr = _host,
- "setName"_attr = _setUri.getSetName());
+ LOGV2_DEBUG(
+ 4333227,
+ kLogLevel,
+ "RSM {replicaSet} monitoring {host} in expedited mode until we detect a primary.",
+ "host"_attr = _host,
+ "replicaSet"_attr = _setUri.getSetName());
// This will change the _currentRefreshPeriod to the shorter expedited duration.
_isExpedited = true;
@@ -116,9 +117,9 @@ void SingleServerIsMasterMonitor::requestImmediateCheck() {
if (_isMasterOutstanding) {
LOGV2_DEBUG(4333216,
kLogLevel + 2,
- "RSM {setName} immediate isMaster check requested, but there "
+ "RSM {replicaSet} immediate isMaster check requested, but there "
"is already an outstanding request.",
- "setName"_attr = _setUri.getSetName());
+ "replicaSet"_attr = _setUri.getSetName());
return;
}
@@ -164,7 +165,7 @@ void SingleServerIsMasterMonitor::_rescheduleNextIsMaster(WithLock lock, Millise
LOGV2_DEBUG(4333218,
kLogLevel,
"Rescheduling the next replica set monitoring request",
- "setName"_attr = _setUri.getSetName(),
+ "replicaSet"_attr = _setUri.getSetName(),
"host"_attr = _host,
"duration"_attr = delay);
_cancelOutstandingRequest(lock);
@@ -249,9 +250,9 @@ SingleServerIsMasterMonitor::_scheduleStreamableIsMaster() {
self->_isMasterOutstanding = false;
LOGV2_DEBUG(4495400,
kLogLevel,
- "RSM {setName} not processing response: {status}",
+ "RSM {replicaSet} not processing response: {status}",
"status"_attr = result.response.status,
- "setName"_attr = self->_setUri.getSetName());
+ "replicaSet"_attr = self->_setUri.getSetName());
return;
}
@@ -306,9 +307,9 @@ StatusWith<TaskExecutor::CallbackHandle> SingleServerIsMasterMonitor::_scheduleS
if (self->_isShutdown) {
LOGV2_DEBUG(4333219,
kLogLevel,
- "RSM {setName} not processing response: {status}",
+ "RSM {replicaSet} not processing response: {status}",
"status"_attr = result.response.status,
- "setName"_attr = self->_setUri.getSetName());
+ "replicaSet"_attr = self->_setUri.getSetName());
return;
}
@@ -351,9 +352,9 @@ void SingleServerIsMasterMonitor::shutdown() {
LOGV2_DEBUG(4333220,
kLogLevel + 1,
- "RSM {setName} Closing host {host}",
+ "RSM {replicaSet} Closing host {host}",
"host"_attr = _host,
- "setName"_attr = _setUri.getSetName());
+ "replicaSet"_attr = _setUri.getSetName());
_cancelOutstandingRequest(lock);
@@ -361,9 +362,9 @@ void SingleServerIsMasterMonitor::shutdown() {
LOGV2_DEBUG(4333229,
kLogLevel + 1,
- "RSM {setName} Done Closing host {host}",
+ "RSM {replicaSet} Done Closing host {host}",
"host"_attr = _host,
- "setName"_attr = _setUri.getSetName());
+ "replicaSet"_attr = _setUri.getSetName());
}
void SingleServerIsMasterMonitor::_cancelOutstandingRequest(WithLock) {
@@ -381,9 +382,9 @@ void SingleServerIsMasterMonitor::_cancelOutstandingRequest(WithLock) {
void SingleServerIsMasterMonitor::_onIsMasterSuccess(const BSONObj bson) {
LOGV2_DEBUG(4333221,
kLogLevel + 1,
- "RSM {setName} received successful isMaster for server {host}: {bson}",
+ "RSM {replicaSet} received successful isMaster for server {host}: {bson}",
"host"_attr = _host,
- "setName"_attr = _setUri.getSetName(),
+ "replicaSet"_attr = _setUri.getSetName(),
"bson"_attr = bson.toString());
_eventListener->onServerHeartbeatSucceededEvent(_host, bson);
@@ -392,10 +393,10 @@ void SingleServerIsMasterMonitor::_onIsMasterSuccess(const BSONObj bson) {
void SingleServerIsMasterMonitor::_onIsMasterFailure(const Status& status, const BSONObj bson) {
LOGV2_DEBUG(4333222,
kLogLevel,
- "RSM {setName} received failed isMaster for server {host}: {status}: {bson}",
+ "RSM {replicaSet} received failed isMaster for server {host}: {status}: {bson}",
"host"_attr = _host,
"status"_attr = status.toString(),
- "setName"_attr = _setUri.getSetName(),
+ "replicaSet"_attr = _setUri.getSetName(),
"bson"_attr = bson.toString());
_eventListener->onServerHeartbeatFailureEvent(status, _host, bson);
@@ -443,8 +444,8 @@ ServerIsMasterMonitor::ServerIsMasterMonitor(
_setUri(setUri) {
LOGV2_DEBUG(4333223,
kLogLevel,
- "RSM {setName} monitoring {size} members.",
- "setName"_attr = _setUri.getSetName(),
+ "RSM {replicaSet} monitoring {size} members.",
+ "replicaSet"_attr = _setUri.getSetName(),
"size"_attr = initialTopologyDescription->getServers().size());
onTopologyDescriptionChangedEvent(
initialTopologyDescription->getId(), nullptr, initialTopologyDescription);
@@ -486,8 +487,8 @@ void ServerIsMasterMonitor::onTopologyDescriptionChangedEvent(
singleMonitor->shutdown();
LOGV2_DEBUG(4333225,
kLogLevel,
- "RSM {setName} host {addr} was removed from the topology.",
- "setName"_attr = _setUri.getSetName(),
+ "RSM {replicaSet} host {addr} was removed from the topology.",
+ "replicaSet"_attr = _setUri.getSetName(),
"addr"_attr = serverAddress);
it = _singleMonitors.erase(it, ++it);
} else {
@@ -503,8 +504,8 @@ void ServerIsMasterMonitor::onTopologyDescriptionChangedEvent(
if (isMissing) {
LOGV2_DEBUG(4333226,
kLogLevel,
- "RSM {setName} {addr} was added to the topology.",
- "setName"_attr = _setUri.getSetName(),
+ "RSM {replicaSet} {addr} was added to the topology.",
+ "replicaSet"_attr = _setUri.getSetName(),
"addr"_attr = serverAddress);
_singleMonitors[serverAddress] = std::make_shared<SingleServerIsMasterMonitor>(
_setUri,
diff --git a/src/mongo/client/streamable_replica_set_monitor.cpp b/src/mongo/client/streamable_replica_set_monitor.cpp
index fdbf78aaa44..ed2c75090d5 100644
--- a/src/mongo/client/streamable_replica_set_monitor.cpp
+++ b/src/mongo/client/streamable_replica_set_monitor.cpp
@@ -209,13 +209,13 @@ void StreamableReplicaSetMonitor::drop() {
lock, Status{ErrorCodes::ShutdownInProgress, "the ReplicaSetMonitor is shutting down"});
}
- LOGV2(4333209, "Closing Replica Set Monitor {setName}", "setName"_attr = getName());
+ LOGV2(4333209, "Closing Replica Set Monitor {replicaSet}", "replicaSet"_attr = getName());
_queryProcessor->shutdown();
_pingMonitor->shutdown();
_isMasterMonitor->shutdown();
ReplicaSetMonitorManager::get()->getNotifier().onDroppedSet(getName());
- LOGV2(4333210, "Done closing Replica Set Monitor {setName}", "setName"_attr = getName());
+ LOGV2(4333210, "Done closing Replica Set Monitor {replicaSet}", "replicaSet"_attr = getName());
}
SemiFuture<HostAndPort> StreamableReplicaSetMonitor::getHostOrRefresh(
@@ -257,8 +257,8 @@ SemiFuture<std::vector<HostAndPort>> StreamableReplicaSetMonitor::getHostsOrRefr
_isMasterMonitor->requestImmediateCheck();
LOGV2_DEBUG(4333212,
kLowerLogLevel,
- "RSM {setName} start async getHosts with {readPref}",
- "setName"_attr = getName(),
+ "RSM {replicaSet} start async getHosts with {readPref}",
+ "replicaSet"_attr = getName(),
"readPref"_attr = readPrefToStringWithMinOpTime(criteria));
// fail fast on timeout
@@ -310,16 +310,16 @@ SemiFuture<std::vector<HostAndPort>> StreamableReplicaSetMonitor::_enqueueOutsta
query->promise.setError(errorStatus);
query->done = true;
LOGV2_INFO(4333208,
- "RSM {setName} host selection timeout: {status}",
- "setName"_attr = getName(),
+ "RSM {replicaSet} host selection timeout: {status}",
+ "replicaSet"_attr = getName(),
"error"_attr = errorStatus.toString());
};
auto swDeadlineHandle = _executor->scheduleWorkAt(query->deadline, deadlineCb);
if (!swDeadlineHandle.isOK()) {
LOGV2_INFO(4333207,
- "RSM {setName} error scheduling deadline handler: {status}",
- "setName"_attr = getName(),
+ "RSM {replicaSet} error scheduling deadline handler: {status}",
+ "replicaSet"_attr = getName(),
"error"_attr = swDeadlineHandle.getStatus());
return SemiFuture<HostAndPortList>::makeReady(swDeadlineHandle.getStatus());
}
@@ -579,8 +579,8 @@ void StreamableReplicaSetMonitor::onTopologyDescriptionChangedEvent(
// Notify external components if there are membership changes in the topology.
if (_hasMembershipChange(previousDescription, newDescription)) {
LOGV2(4333213,
- "RSM {setName} Topology Change: {topologyDescription}",
- "setName"_attr = getName(),
+ "RSM {replicaSet} Topology Change: {topologyDescription}",
+ "replicaSet"_attr = getName(),
"topologyDescription"_attr = newDescription->toString());
auto maybePrimary = newDescription->getPrimary();
@@ -604,7 +604,7 @@ void StreamableReplicaSetMonitor::onTopologyDescriptionChangedEvent(
kLowerLogLevel,
"Skip publishing unconfirmed replica set members since there are "
"no primaries or secondaries in the new topology",
- "setName"_attr = getName());
+ "replicaSet"_attr = getName());
return;
}
@@ -647,7 +647,7 @@ void StreamableReplicaSetMonitor::onServerPingSucceededEvent(sdam::IsMasterRTT d
kLowerLogLevel,
"ReplicaSetMonitor ping success",
"host"_attr = hostAndPort,
- "setName"_attr = getName(),
+ "replicaSet"_attr = getName(),
"duration"_attr = durationMS);
_topologyManager->onServerRTTUpdated(hostAndPort, durationMS);
}
@@ -726,8 +726,8 @@ void StreamableReplicaSetMonitor::_processOutstanding(
const auto latency = _executor->now() - query->start;
LOGV2_DEBUG(433214,
kLowerLogLevel,
- "RSM {setName} finished async getHosts: {readPref} ({latency})",
- "setName"_attr = getName(),
+ "RSM {replicaSet} finished async getHosts: {readPref} ({latency})",
+ "replicaSet"_attr = getName(),
"readPref"_attr = readPrefToStringWithMinOpTime(query->criteria),
"latency"_attr = latency.toString());
shouldRemove = true;
diff --git a/src/mongo/client/streamable_replica_set_monitor_error_handler.cpp b/src/mongo/client/streamable_replica_set_monitor_error_handler.cpp
index be19b1e64ec..7f04cc2ee10 100644
--- a/src/mongo/client/streamable_replica_set_monitor_error_handler.cpp
+++ b/src/mongo/client/streamable_replica_set_monitor_error_handler.cpp
@@ -46,7 +46,7 @@ SdamErrorHandler::ErrorActions SdamErrorHandler::computeErrorActions(const HostA
LOGV2(4712102,
"Host failed in replica set",
- "setName"_attr = _setName,
+ "replicaSet"_attr = _setName,
"host"_attr = host,
"error"_attr = status,
"action"_attr = result);
diff --git a/src/mongo/client/streamable_replica_set_monitor_query_processor.cpp b/src/mongo/client/streamable_replica_set_monitor_query_processor.cpp
index bab19ae76fd..4e7a2034396 100644
--- a/src/mongo/client/streamable_replica_set_monitor_query_processor.cpp
+++ b/src/mongo/client/streamable_replica_set_monitor_query_processor.cpp
@@ -57,8 +57,8 @@ void StreamableReplicaSetMonitor::StreamableReplicaSetMonitorQueryProcessor::
if (!replicaSetMonitor) {
LOGV2_DEBUG(4333215,
kLogLevel,
- "could not find rsm instance {setName} for query processing.",
- "setName"_attr = *setName);
+ "could not find rsm instance {replicaSet} for query processing.",
+ "replicaSet"_attr = *setName);
return;
}
replicaSetMonitor->_processOutstanding(newDescription);