From 79f9c3cc050c07a4f33d4ad379625d380ddf3b8c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 8 May 2009 12:55:16 -0700 Subject: [PATCH] osd: reset heartbeat peer set on osd down This clears out the timers. --- src/osd/OSD.cc | 13 +++++++++++++ src/osd/OSD.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 0ec1f69a3a32e..e1d19579250b4 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -936,6 +936,17 @@ void OSD::update_heartbeat_peers() heartbeat_lock.Unlock(); } +void OSD::reset_heartbeat_peers() +{ + dout(10) << "reset_heartbeat_peers" << dendl; + heartbeat_lock.Lock(); + heartbeat_to.clear(); + heartbeat_from.clear(); + heartbeat_from_stamp.clear(); + heartbeat_inst.clear(); + heartbeat_lock.Unlock(); +} + void OSD::handle_osd_ping(MOSDPing *m) { dout(20) << "handle_osd_ping from " << m->get_source() << " got stat " << m->peer_stat << dendl; @@ -1908,6 +1919,8 @@ void OSD::handle_osd_map(MOSDMap *m) state = STATE_BOOTING; boot_epoch = 0; + + reset_heartbeat_peers(); } diff --git a/src/osd/OSD.h b/src/osd/OSD.h index d314a2cbecede..56abad447e4f3 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -171,6 +171,7 @@ private: Messenger *heartbeat_messenger; void update_heartbeat_peers(); + void reset_heartbeat_peers(); void heartbeat(); void heartbeat_entry(); -- 2.39.5