]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: ignore xinfo if features == 0
authorSage Weil <sage@redhat.com>
Tue, 19 Sep 2017 22:25:56 +0000 (18:25 -0400)
committerKarol Mroz <kmroz@suse.de>
Fri, 20 Oct 2017 16:21:55 +0000 (09:21 -0700)
Some old bug (e.g., http://tracker.ceph.com/issues/20751) could
result in an UP+EXISTS osd having features==0.  If that happens,
we shouldn't crash the mon, which (reasonably) does

   if (osdmap.get_epoch()) {
     if (osdmap.get_num_up_osds() > 0) {
       assert(osdmap.get_up_osd_features() & CEPH_FEATURE_MON_STATEFUL_SUB);
       check_subs();
     }
   }

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 8399833f3d221364a8ededb97cd4e1c5a258d924)

src/osd/OSDMap.cc

index 59ba80106ca3bef827ba796fa7a7a7739124280e..d26a895dff55292115ca3fdaa5cb73870ec55e38 100644 (file)
@@ -1451,6 +1451,8 @@ void OSDMap::_calc_up_osd_features()
     if (!is_up(osd))
       continue;
     const osd_xinfo_t &xi = get_xinfo(osd);
+    if (xi.features == 0)
+      continue;  // bogus xinfo, maybe #20751 or similar, skipping
     if (first) {
       cached_up_osd_features = xi.features;
       first = false;