diff options
author | Ben Caimano <ben.caimano@10gen.com> | 2019-02-20 11:01:22 -0500 |
---|---|---|
committer | Ben Caimano <ben.caimano@10gen.com> | 2019-02-20 11:32:26 -0500 |
commit | 601ed1b88afe54f79e39c298cd2c578795bfc17b (patch) | |
tree | e65c04504fa8bc4086ce1004b53096862f8cde6a /src/mongo/db | |
parent | 56a3a1c3d450439b8e571ea22678eb88b60ecab1 (diff) | |
download | mongo-601ed1b88afe54f79e39c298cd2c578795bfc17b.tar.gz |
SERVER-37412 Decrease replication heartbeat log verbosity
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/repl/topology_coordinator.cpp | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp b/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp index 0d082fe65da..5bb5f344457 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp @@ -205,7 +205,7 @@ void ReplicationCoordinatorImpl::_handleHeartbeatResponse( _cancelAndRescheduleElectionTimeout_inlock(); } } else { - LOG_FOR_HEARTBEATS(0) << "Error in heartbeat (requestId: " << cbData.request.id << ") to " + LOG_FOR_HEARTBEATS(2) << "Error in heartbeat (requestId: " << cbData.request.id << ") to " << target << ", response status: " << responseStatus; hbStatusResponse = StatusWith<ReplSetHeartbeatResponse>(responseStatus); diff --git a/src/mongo/db/repl/topology_coordinator.cpp b/src/mongo/db/repl/topology_coordinator.cpp index 3b53eb83b6b..46165018ce7 100644 --- a/src/mongo/db/repl/topology_coordinator.cpp +++ b/src/mongo/db/repl/topology_coordinator.cpp @@ -30,6 +30,8 @@ #define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication #define LOG_FOR_ELECTION(level) \ MONGO_LOG_COMPONENT(level, ::mongo::logger::LogComponent::kReplicationElection) +#define LOG_FOR_HEARTBEATS(level) \ + MONGO_LOG_COMPONENT(level, ::mongo::logger::LogComponent::kReplicationHeartbeats) #include "mongo/platform/basic.h" @@ -733,6 +735,12 @@ HeartbeatResponseAction TopologyCoordinator::processHeartbeatResponse( nextHeartbeatStartDate = now + heartbeatInterval; } + if (hbStats.failed()) { + LOG_FOR_HEARTBEATS(0) << "Heartbeat to " << target << " failed after " + << kMaxHeartbeatRetries + << " retries, response status: " << hbResponse.getStatus(); + } + if (hbResponse.isOK() && hbResponse.getValue().hasConfig()) { const long long currentConfigVersion = _rsConfig.isInitialized() ? _rsConfig.getConfigVersion() : -2; |