]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD,PG: _share_map_outgoing must not require osd_lock
authorSamuel Just <sam.just@inktank.com>
Sun, 17 Jun 2012 23:08:19 +0000 (16:08 -0700)
committerSamuel Just <sam.just@inktank.com>
Thu, 5 Jul 2012 17:15:00 +0000 (10:15 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/OSD.cc
src/osd/OSD.h
src/osd/PG.cc

index 3bb2b0ab87939872538fa95fb780e2231305cd42..f47e9b8461cb4069c0f9e98a7a02bd22e043454f 100644 (file)
@@ -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 {
index e3d24624ecdeb360664a3948e3e0ab9e737ce45f..6cc66c282f25d1a74c0ed10b750f789e934d44d9 100644 (file)
@@ -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);
index 210e77fa18c36ac9df28c841884309c477ccf026..cccebf6a960fee7e89424e8e1b384d1064cdfac9 100644 (file)
@@ -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));
 }