From: Samuel Just Date: Sun, 17 Jun 2012 23:08:19 +0000 (-0700) Subject: OSD,PG: _share_map_outgoing must not require osd_lock X-Git-Tag: v0.50~109^2~2^2~42 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2552a7f430219ca0e95286cabfae1e0fff111fbc;p=ceph.git OSD,PG: _share_map_outgoing must not require osd_lock Signed-off-by: Samuel Just --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 3bb2b0ab8793..f47e9b8461cb 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1695,7 +1695,7 @@ void OSD::handle_osd_ping(MOSDPing *m) if (osdmap->is_up(from)) { note_peer_epoch(from, m->map_epoch); if (locked && is_active()) - _share_map_outgoing(osdmap->get_cluster_inst(from)); + _share_map_outgoing(service.get_osdmap()->get_cluster_inst(from)); } } break; @@ -1713,10 +1713,10 @@ void OSD::handle_osd_ping(MOSDPing *m) } if (m->map_epoch && // peer may not have gotten map_lock on ping reply - osdmap->is_up(from)) { + service.get_osdmap()->is_up(from)) { note_peer_epoch(from, m->map_epoch); if (locked && is_active()) - _share_map_outgoing(osdmap->get_cluster_inst(from)); + _share_map_outgoing(service.get_osdmap()->get_cluster_inst(from)); } } break; @@ -2732,8 +2732,11 @@ bool OSD::_share_map_incoming(const entity_inst_t& inst, epoch_t epoch, } -void OSD::_share_map_outgoing(const entity_inst_t& inst) +void OSD::_share_map_outgoing(const entity_inst_t& inst, + OSDMapRef map) { + if (!map) + map = service.get_osdmap(); assert(inst.name.is_osd()); int peer = inst.name.num(); @@ -2743,9 +2746,9 @@ void OSD::_share_map_outgoing(const entity_inst_t& inst) // send map? epoch_t pe = get_peer_epoch(peer); if (pe) { - if (pe < osdmap->get_epoch()) { + if (pe < map->get_epoch()) { send_incremental_map(pe, inst); - note_peer_epoch(peer, osdmap->get_epoch()); + note_peer_epoch(peer, map->get_epoch()); } else dout(20) << "_share_map_outgoing " << inst << " already has epoch " << pe << dendl; } else { diff --git a/src/osd/OSD.h b/src/osd/OSD.h index e3d24624ecde..6cc66c282f25 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -630,7 +630,8 @@ private: bool _share_map_incoming(const entity_inst_t& inst, epoch_t epoch, Session *session = 0); - void _share_map_outgoing(const entity_inst_t& inst); + void _share_map_outgoing(const entity_inst_t& inst, + OSDMapRef map = OSDMapRef()); void wait_for_new_map(OpRequestRef op); void handle_osd_map(class MOSDMap *m); diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 210e77fa18c3..cccebf6a960f 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3556,7 +3556,8 @@ void PG::fulfill_log(int from, const pg_query_t &query, epoch_t query_epoch) dout(10) << " sending " << mlog->log << " " << mlog->missing << dendl; - osd->osd->_share_map_outgoing(get_osdmap()->get_cluster_inst(from)); + osd->osd->_share_map_outgoing(get_osdmap()->get_cluster_inst(from), + get_osdmap()); osd->cluster_messenger->send_message(mlog, get_osdmap()->get_cluster_inst(from)); }