From: Sage Weil Date: Wed, 25 May 2011 23:20:26 +0000 (-0700) Subject: osd: fix map sharing due to heartbeats X-Git-Tag: v0.29~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e5c9100bca5304ba901abb2286283d89fb1a4bd9;p=ceph.git osd: fix map sharing due to heartbeats - share the map with the cluster addr - use the new {note,get}_peer_epoch helpers to do it sanely - don't share if we're booting; see 818fa33a661 Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 2224e67d7146..3bd6520a6df7 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1488,7 +1488,7 @@ void OSD::update_heartbeat_peers() // share latest map with this peer so they know not to expect // heartbeats from us. otherwise they may mark us down! - if (osdmap->is_up(p->first)) { + if (osdmap->is_up(p->first) && !is_booting()) { dout(10) << "update_heartbeat_peers: sharing map with old _to peer osd" << p->first << dendl; _share_map_outgoing(osdmap->get_cluster_inst(p->first)); } @@ -1512,7 +1512,7 @@ void OSD::update_heartbeat_peers() continue; // share latest map with this peer, just to be nice. - if (osdmap->is_up(p->first)) { + if (osdmap->is_up(p->first) && !is_booting()) { dout(10) << "update_heartbeat_peers: sharing map with old _from peer osd" << p->first << dendl; _share_map_outgoing(osdmap->get_cluster_inst(p->first)); } @@ -1531,7 +1531,7 @@ void OSD::update_heartbeat_peers() for (map::iterator p = down.begin(); p != down.end(); ++p) { Connection *con = p->second; heartbeat_messenger->mark_disposable(con); - if (!osdmap->is_up(p->first)) { + if (!osdmap->is_up(p->first) && !is_booting()) { dout(10) << "update_heartbeat_peers: telling old peer osd" << p->first << " " << old_con[p->first]->get_peer_addr() << " they are down" << dendl; @@ -1616,9 +1616,6 @@ void OSD::handle_osd_ping(MOSDPing *m) if (locked) { dout(20) << "handle_osd_ping " << m->get_source_inst() << " took stat " << m->peer_stat << dendl; - if (m->map_epoch && !is_booting()) - _share_map_incoming(m->get_source_inst(), m->map_epoch, - (Session*) m->get_connection()->get_priv()); take_peer_stat(from, m->peer_stat); // only with map_lock held! } else { dout(20) << "handle_osd_ping " << m->get_source_inst() @@ -1626,6 +1623,8 @@ void OSD::handle_osd_ping(MOSDPing *m) } note_peer_epoch(from, m->map_epoch); + if (locked && !is_booting()) + _share_map_outgoing(osdmap->get_cluster_inst(from)); heartbeat_from_stamp[from] = g_clock.now(); // don't let _my_ lag interfere. @@ -2482,6 +2481,8 @@ void OSD::_share_map_outgoing(const entity_inst_t& inst) int peer = inst.name.num(); + assert(!is_booting()); + // send map? epoch_t pe = get_peer_epoch(peer); if (pe) {