From: Yingxin Cheng Date: Thu, 26 Mar 2020 07:03:08 +0000 (+0800) Subject: crimson/osd: connections are always available in Heartbeat::Peer X-Git-Tag: v16.1.0~1895^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6036953332e5209d8de575ffd15cc9143dffbc1b;p=ceph.git crimson/osd: connections are always available in Heartbeat::Peer No need to check whether con_front or con_back exists, and it complicates the internal states of PeerInfo, so remove the related logic. Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/osd/heartbeat.cc b/src/crimson/osd/heartbeat.cc index 7385f840481b..4ea6185415ee 100644 --- a/src/crimson/osd/heartbeat.cc +++ b/src/crimson/osd/heartbeat.cc @@ -386,10 +386,10 @@ bool Heartbeat::Peer::is_unhealthy(clock::time_point now) const bool Heartbeat::Peer::is_healthy(clock::time_point now) const { - if (con_front && clock::is_zero(last_rx_front)) { + if (clock::is_zero(last_rx_front)) { return false; } - if (con_back && clock::is_zero(last_rx_back)) { + if (clock::is_zero(last_rx_back)) { return false; } // only declare to be healthy until we have received the first @@ -439,21 +439,19 @@ void Heartbeat::Peer::send_heartbeat( [[maybe_unused]] auto [reply, added] = ping_history.emplace(sent_stamp, reply_t{deadline, 0}); for (auto& con : {con_front, con_back}) { - if (con) { - auto min_message = static_cast( - local_conf()->osd_heartbeat_min_size); - auto ping = make_message( - heartbeat.monc.get_fsid(), - heartbeat.service.get_osdmap_service().get_map()->get_epoch(), - MOSDPing::PING, - sent_stamp, - mnow, - mnow, - heartbeat.service.get_osdmap_service().get_up_epoch(), - min_message); - reply->second.unacknowledged++; - futures.push_back(con->send(std::move(ping))); - } + auto min_message = static_cast( + local_conf()->osd_heartbeat_min_size); + auto ping = make_message( + heartbeat.monc.get_fsid(), + heartbeat.service.get_osdmap_service().get_map()->get_epoch(), + MOSDPing::PING, + sent_stamp, + mnow, + mnow, + heartbeat.service.get_osdmap_service().get_up_epoch(), + min_message); + reply->second.unacknowledged++; + futures.push_back(con->send(std::move(ping))); } }