From 4be8a28d5b5ba868d100300ab64ebb82b188222b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 11 Sep 2015 11:00:38 -0400 Subject: [PATCH] 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 --- src/osd/PG.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 { -- 2.39.5