From 49ac8bcc7c8cfdec5d7e60a43b8e4160c10b0260 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 8 Aug 2008 15:15:53 -0700 Subject: [PATCH] osd: filter heartbeat stamps when adding to heartbeat_from set, too --- src/dstartnew.sh | 2 +- src/osd/OSD.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dstartnew.sh b/src/dstartnew.sh index c21119054b577..32c91bd12badb 100755 --- a/src/dstartnew.sh +++ b/src/dstartnew.sh @@ -44,7 +44,7 @@ do echo "---- host $host osd $osd dev $dev ----" ls -al $dev ssh cosd$host cd ceph/src \; ./cosd --mkfs_for_osd $osd $dev # --osd_auto_weight 1 - ssh cosd$host cd ceph/src \; ./cosd $dev -d --debug_ms 1 --debug_osd 20 --debug_filestore 10 + ssh cosd$host cd ceph/src \; ./cosd $dev -d --debug_ms 1 --debug_osd 20 --debug_filestore 10 --debug_ebofs 30 --osd_heartbeat_grace 300 # ssh cosd$host cd ceph/src \; valgrind --leak-check-full --show-reachable-yes ./cosd $dev --debug_ms 1 --debug_osd 20 --debug_filestore 10 1>out/o$osd \& done done diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 95d1ffb2491f5..e670538b25182 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -874,6 +874,9 @@ void OSD::update_heartbeat_peers() map stamps; stamps.swap(heartbeat_from_stamp); + set old_heartbeat_from; + old_heartbeat_from.swap(heartbeat_from); + // build heartbeat to/from set heartbeat_to.clear(); heartbeat_from.clear(); @@ -893,7 +896,7 @@ void OSD::update_heartbeat_peers() int p = pg->acting[i]; // peer assert(p != whoami); heartbeat_from.insert(p); - if (stamps.count(p)) + if (stamps.count(p) && old_heartbeat_from.count(p)) // have a stamp _AND_ i'm not new to the set heartbeat_from_stamp[p] = stamps[p]; } } -- 2.39.5