summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/reporter.cpp
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2020-02-13 11:49:46 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-13 18:16:35 +0000
commita84c09a19720b73cedb2e8ef7c5cfeedfa1c9761 (patch)
tree85ac46cd5f4ea6d5134560bf764fb9e6cf11fe4e /src/mongo/db/repl/reporter.cpp
parent6df40e01f7b6899affc4536e7e73a35802cabf98 (diff)
downloadmongo-a84c09a19720b73cedb2e8ef7c5cfeedfa1c9761.tar.gz
SERVER-45869 automatically converted structured logging
Diffstat (limited to 'src/mongo/db/repl/reporter.cpp')
-rw-r--r--src/mongo/db/repl/reporter.cpp32
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;