From: Sage Weil Date: Fri, 11 Sep 2015 15:00:38 +0000 (-0400) Subject: osd/PG: peek_map_epoch: skip legacy PGs if infos object is missing X-Git-Tag: v0.94.4~27^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5892%2Fhead;p=ceph.git osd/PG: peek_map_epoch: skip legacy PGs if infos object is missing - pg is removed - osd is stopped before pg is fully removed - on restart, we ignore/skip the pg because its epoch is too old - we upgrade to hammer and convert other pgs, skipping this one, and then remove the legacy infos object - hammer starts, tries to parse the legacy pg, and fails because the infos object is gone, crashing. The fix is to continue ignoring the zombie pg. Fixes: #16030 Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 3abfc5a412598..7b91bf8c97d93 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2866,7 +2866,12 @@ int PG::peek_map_epoch(ObjectStore *store, values.clear(); keys.insert(ek); store->omap_get_values(META_COLL, legacy_infos_oid, keys, &values); - assert(values.size() == 1); + if (values.size() < 1) { + // see #13060: this suggests we failed to upgrade this pg + // because it was a zombie and then removed the legacy infos + // object. skip it. + return -1; + } bufferlist::iterator p = values[ek].begin(); ::decode(cur_epoch, p); } else {