]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: clear hb_front if it was previously non-NULL and is now NULL
authorSage Weil <sage@inktank.com>
Wed, 3 Jul 2013 22:37:05 +0000 (15:37 -0700)
committerSage Weil <sage@inktank.com>
Wed, 3 Jul 2013 22:37:05 +0000 (15:37 -0700)
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 <sage@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
src/osd/OSD.cc
src/osd/OSDMap.cc

index bab345324d0254e77a39207b7389a125881419dd..5209ec36bf499470afd000bd5c555bb5cfa28549 100644 (file)
@@ -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;
   }
index 711997782a8e1c5207a3a49cf4f0019a6f627f95..00bf8e6806b587339b5ac68d9b3a56d3e58f4082 100644 (file)
@@ -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<int32_t,entity_addr_t>::const_iterator i = inc.new_up_cluster.begin();