From d9123158d1fef329fb9bf5ff787f9c84bb51b44c Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Mon, 8 Jan 2018 15:02:58 +0800 Subject: [PATCH] osd/OSD: fix HeartbeatInfo.is_healthy() check Delay to declared to be healthy until we have received the first replies from both front and back connections. Signed-off-by: xie xingguo --- src/osd/OSD.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 7c79bcc317af3..f1fe9db9ea728 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1526,6 +1526,11 @@ class OSD : public Dispatcher, } bool is_healthy(utime_t now) { + if (last_rx_front == utime_t() || last_rx_back == utime_t()) { + // only declare to be healthy until we have received the first + // replies from both front/back connections + return false; + } return !is_unhealthy(now); } };