]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdmap: fix cluster_addr encoding; printing
authorSage Weil <sage@newdream.net>
Mon, 22 Nov 2010 04:46:41 +0000 (20:46 -0800)
committerSage Weil <sage@newdream.net>
Mon, 22 Nov 2010 04:52:40 +0000 (20:52 -0800)
The cluster addrs were getting lost because we were checking v instead of
ev.

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/OSDMap.cc
src/osd/OSDMap.h

index f4767b4bf1e20aeed0cf581c6a1c8ef923133b5d..33a6dac4424eac93855b3803c608648154a8c8d7 100644 (file)
@@ -66,7 +66,7 @@ void OSDMap::print(ostream& out) const
       const osd_info_t& info(get_info(i));
       out << " " << info;
       if (is_up(i))
-       out << " " << get_addr(i) << " " << get_hb_addr(i);
+       out << " " << get_addr(i) << " " << get_cluster_addr(i) << " " << get_hb_addr(i);
       out << "\n";
     }
   }
index 5e6c2a91425d7d2c62c2bd0fad2f1b06ad690d1d..2ccafbbc7563cb54bf4e52034645aca8007c6537 100644 (file)
@@ -233,7 +233,7 @@ public:
       ::decode(new_lost, p);
       ::decode(new_blacklist, p);
       ::decode(old_blacklist, p);
-      if (v >= 6)
+      if (ev >= 6)
         ::decode(new_up_internal, p);
     }
 
@@ -579,21 +579,16 @@ private:
          i++) {
       osd_state[i->first] |= CEPH_OSD_EXISTS | CEPH_OSD_UP;
       osd_addr[i->first] = i->second;
-      if (inc.new_hb_up.empty()) {
-       //this is a backward-compatibility hack
-       osd_hb_addr[i->first] = i->second;
-       //osd_hb_addr[i->first].erank = osd_hb_addr[i->first].erank + 1;
-      }
-      else osd_hb_addr[i->first] = inc.new_hb_up[i->first];
+      if (inc.new_hb_up.empty())
+       osd_hb_addr[i->first] = i->second;      //this is a backward-compatibility hack
+      else
+       osd_hb_addr[i->first] = inc.new_hb_up[i->first];
       osd_info[i->first].up_from = epoch;
-      //cout << "epoch " << epoch << " up osd" << i->first << " at " << i->second << "with hb addr" << osd_hb_addr[i->first] << std::endl;
     }
     for (map<int32_t,entity_addr_t>::iterator i = inc.new_up_internal.begin();
-        i != inc.new_up_internal.end();
-        ++i)
+         i != inc.new_up_internal.end();
+         i++)
       osd_cluster_addr[i->first] = i->second;
-    if (osd_cluster_addr.size() != osd_addr.size())
-        osd_cluster_addr.resize(osd_addr.size());
     // info
     for (map<int32_t,epoch_t>::iterator i = inc.new_up_thru.begin();
          i != inc.new_up_thru.end();
@@ -721,9 +716,9 @@ private:
       ::decode(pool_name, p);
    
     ::decode(blacklist, p);
-    if (v>=6)
+    if (ev >= 6)
       ::decode(osd_cluster_addr, p);
-    if (osd_cluster_addr.size() != osd_addr.size())
+    else
       osd_cluster_addr.resize(osd_addr.size());
 
     // index pool names