From: Sage Weil Date: Wed, 3 Jul 2013 22:37:05 +0000 (-0700) Subject: osd: clear hb_front if it was previously non-NULL and is now NULL X-Git-Tag: v0.66~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=81343f1df4b55d6069a4e81b858f3bf1aea1cea9;p=ceph.git osd: clear hb_front if it was previously non-NULL and is now NULL If we have a real addr for hb_front for a given osd and then a new map has the osd coming up without an hb_front, we need to clear the addr field. Also, improve the debug output in add_heartbeat_peer() so we can tell if we have no connection or a connection to a blank addr. Signed-off-by: Sage Weil Reviewed-by: David Zafman --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index bab345324d0..5209ec36bf4 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2518,11 +2518,16 @@ void OSD::_add_heartbeat_peer(int p) if (cons.second) { hi->con_front = cons.second.get(); hi->con_front->set_priv(s->get()); + dout(10) << "_add_heartbeat_peer: new peer osd." << p + << " " << hi->con_back->get_peer_addr() + << " " << hi->con_front->get_peer_addr() + << dendl; + } else { + hi->con_front.reset(NULL); + dout(10) << "_add_heartbeat_peer: new peer osd." << p + << " " << hi->con_back->get_peer_addr() + << dendl; } - dout(10) << "_add_heartbeat_peer: new peer osd." << p - << " " << hi->con_back->get_peer_addr() - << " " << (hi->con_front ? hi->con_front->get_peer_addr() : entity_addr_t()) - << dendl; } else { hi = &i->second; } diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 711997782a8..00bf8e6806b 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -904,6 +904,9 @@ int OSDMap::apply_incremental(const Incremental &inc) if (!inc.new_hb_front_up.empty()) osd_addrs->hb_front_addr[i->first].reset( new entity_addr_t(inc.new_hb_front_up.find(i->first)->second)); + else + osd_addrs->hb_front_addr[i->first].reset(); + osd_info[i->first].up_from = epoch; } for (map::const_iterator i = inc.new_up_cluster.begin();