]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix decoding for old osdmaps (pre osd hb change)
authorSage Weil <sage@newdream.net>
Wed, 9 Dec 2009 18:17:30 +0000 (10:17 -0800)
committerSage Weil <sage@newdream.net>
Wed, 9 Dec 2009 18:27:56 +0000 (10:27 -0800)
Including ugly hack to work around badly encoded v3 maps

src/osd/OSDMap.h

index 139a179b4bb1fc2f23272bb852830b6700a85e49..21176dfb0c4516c6be50bdfd7a0f399f4958297b 100644 (file)
@@ -624,7 +624,15 @@ private:
     crush.decode(cblp);
 
     // extended
-    ::decode(osd_hb_addr, p);
+    if (v >= 3)
+      ::decode(osd_hb_addr, p);
+    if (v < 3 || (osd_hb_addr.empty() && osd_addr.size())) {
+      osd_hb_addr.resize(osd_addr.size());
+      for (unsigned i=0; i<osd_addr.size(); i++) {
+       osd_hb_addr[i] = osd_addr[i];
+       osd_hb_addr[i].erank = osd_hb_addr[i].erank + 1;
+      }
+    }
     ::decode(osd_info, p);
     ::decode(pool_name, p);
     name_pool.clear();