diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/osd/OSD.cc | 2 | ||||
-rw-r--r-- | src/osd/OSD.h | 18 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 0e65172723c..f08a63a8ae3 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2592,7 +2592,7 @@ void OSD::heartbeat_check() << " last_rx_back " << p->second.last_rx_back << " last_rx_front " << p->second.last_rx_front << dendl; - if (!p->second.is_healthy(cutoff)) { + if (p->second.is_unhealthy(cutoff)) { if (p->second.last_rx_back == utime_t() || p->second.last_rx_front == utime_t()) { derr << "heartbeat_check: no reply from osd." << p->first diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 4eb7c9f330a..50f7c9c073d 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -704,15 +704,19 @@ private: utime_t last_rx_back; ///< last time we got a ping reply on the back side epoch_t epoch; ///< most recent epoch we wanted this peer - bool is_healthy(utime_t cutoff) { + bool is_unhealthy(utime_t cutoff) { return - (last_rx_front > cutoff || - (last_rx_front == utime_t() && (last_tx == utime_t() || - first_tx > cutoff))) && - (last_rx_back > cutoff || - (last_rx_back == utime_t() && (last_tx == utime_t() || - first_tx > cutoff))); + ! ((last_rx_front > cutoff || + (last_rx_front == utime_t() && (last_tx == utime_t() || + first_tx > cutoff))) && + (last_rx_back > cutoff || + (last_rx_back == utime_t() && (last_tx == utime_t() || + first_tx > cutoff)))); + } + bool is_healthy(utime_t cutoff) { + return last_rx_front > cutoff && last_rx_back > cutoff; } + }; /// state attached to outgoing heartbeat connections struct HeartbeatSession : public RefCountedObject { |