summaryrefslogtreecommitdiff
path: root/src/osd/OSD.h
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-05-29 13:15:41 -0700
committerSage Weil <sage@inktank.com>2013-05-29 22:43:49 -0700
commit04aa2b5edf72eb59a5dc688475df59dda25a3cac (patch)
tree68dedfd2cf7756ba55db4501e4162be7c953aba4 /src/osd/OSD.h
parent28ea184d3a37fa8d878c82571ae64607c6717b43 (diff)
downloadceph-04aa2b5edf72eb59a5dc688475df59dda25a3cac.tar.gz
osd: distinguish between definitely healthy and definitely not unhealthy
is_unhealthy() will assume they are healthy for some period after we send our first ping attempt. is_healthy() is now a strict check that we know they are healthy. Switch the failure report check to use is_unhealthy(); use is_healthy() everywhere else, including the waiting-for-healthy pre-boot checks. Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/osd/OSD.h')
-rw-r--r--src/osd/OSD.h18
1 files changed, 11 insertions, 7 deletions
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 {