diff options
Diffstat (limited to 'src/mongo/db/repl/reporter.cpp')
-rw-r--r-- | src/mongo/db/repl/reporter.cpp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/src/mongo/db/repl/reporter.cpp b/src/mongo/db/repl/reporter.cpp index f66eb930893..2d23ef4e256 100644 --- a/src/mongo/db/repl/reporter.cpp +++ b/src/mongo/db/repl/reporter.cpp @@ -37,6 +37,7 @@ #include "mongo/bson/util/bson_extract.h" #include "mongo/db/commands/server_status_metric.h" #include "mongo/db/repl/update_position_args.h" +#include "mongo/logv2/log.h" #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/util/assert_util.h" #include "mongo/util/destructor_guard.h" @@ -190,8 +191,11 @@ Status Reporter::trigger() { _status = scheduleResult.getStatus(); if (!_status.isOK()) { - LOG(2) << "Reporter failed to schedule callback to prepare and send update command: " - << _status; + LOGV2_DEBUG( + 21585, + 2, + "Reporter failed to schedule callback to prepare and send update command: {status}", + "status"_attr = _status); return _status; } @@ -212,8 +216,11 @@ StatusWith<BSONObj> Reporter::_prepareCommand() { // If there was an error in preparing the command, abort and return that error. if (!prepareResult.isOK()) { - LOG(2) << "Reporter failed to prepare update command with status: " - << prepareResult.getStatus(); + LOGV2_DEBUG( + 21586, + 2, + "Reporter failed to prepare update command with status: {prepareResult_getStatus}", + "prepareResult_getStatus"_attr = prepareResult.getStatus()); _status = prepareResult.getStatus(); return _status; } @@ -222,8 +229,12 @@ StatusWith<BSONObj> Reporter::_prepareCommand() { } void Reporter::_sendCommand_inlock(BSONObj commandRequest, Milliseconds netTimeout) { - LOG(2) << "Reporter sending slave oplog progress to upstream updater " << _target << ": " - << commandRequest; + LOGV2_DEBUG( + 21587, + 2, + "Reporter sending slave oplog progress to upstream updater {target}: {commandRequest}", + "target"_attr = _target, + "commandRequest"_attr = commandRequest); auto scheduleResult = _executor->scheduleRemoteCommand( executor::RemoteCommandRequest(_target, "admin", commandRequest, nullptr, netTimeout), @@ -233,7 +244,8 @@ void Reporter::_sendCommand_inlock(BSONObj commandRequest, Milliseconds netTimeo _status = scheduleResult.getStatus(); if (!_status.isOK()) { - LOG(2) << "Reporter failed to schedule with status: " << _status; + LOGV2_DEBUG( + 21588, 2, "Reporter failed to schedule with status: {status}", "status"_attr = _status); if (_status != ErrorCodes::ShutdownInProgress) { fassert(34434, _status); } @@ -272,8 +284,10 @@ void Reporter::_processResponseCallback( // sync target. if (_status == ErrorCodes::InvalidReplicaSetConfig && _isTargetConfigNewerThanRequest(commandResult, rcbd.request.cmdObj)) { - LOG(1) << "Reporter found newer configuration on sync source: " << _target - << ". Retrying."; + LOGV2_DEBUG(21589, + 1, + "Reporter found newer configuration on sync source: {target}. Retrying.", + "target"_attr = _target); _status = Status::OK(); // Do not resend update command immediately. _isWaitingToSendReporter = false; |