From e787871fa8531b8ff85b32fd951c30b1d26cf9c8 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 30 Jul 2008 21:54:40 -0700 Subject: [PATCH] osd: filter heartbeat stamps against source set (fixes false timeout when peer leaves then rejoins from set) --- src/osd/OSD.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index f33b9647fa2..d60025f0d1c 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -863,6 +863,11 @@ void OSD::update_heartbeat_peers() { assert(osd_lock.is_locked()); + // filter heartbeat_from_stamp to only include osds that remain in + // heartbeat_from. + map stamps; + stamps.swap(heartbeat_from_stamp); + // build heartbeat to/from set heartbeat_to.clear(); heartbeat_from.clear(); @@ -879,8 +884,11 @@ void OSD::update_heartbeat_peers() else if (pg->get_role() == 0) { assert(pg->acting[0] == whoami); for (unsigned i=1; iacting.size(); i++) { - assert(pg->acting[i] != whoami); - heartbeat_from.insert(pg->acting[i]); + int p = pg->acting[i]; // peer + assert(p != whoami); + heartbeat_from.insert(p); + if (stamps.count(p)) + heartbeat_from_stamp[p] = stamps[p]; } } } -- 2.47.3