From: Mykola Golub Date: Tue, 21 Sep 2021 10:26:21 +0000 (+0100) Subject: osd: don't crash in backfill due to inconsistent hash info X-Git-Tag: v17.1.0~684^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ffd4d1c34abdfc56dd14402ddcdd0463ed343090;p=ceph.git osd: don't crash in backfill due to inconsistent hash info Instead fail the pull so it will try to recover from other shards (or will mark the object missing). Fixes: https://tracker.ceph.com/issues/48959 Signed-off-by: Mykola Golub --- diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 5388391c4f0d..d9d2b5ae1be7 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -605,7 +605,16 @@ void ECBackend::continue_recovery_op( if (op.recovery_progress.first && op.obc) { /* We've got the attrs and the hinfo, might as well use them */ op.hinfo = get_hash_info(op.hoid); - ceph_assert(op.hinfo); + if (!op.hinfo) { + derr << __func__ << ": " << op.hoid << " has inconsistent hinfo" + << dendl; + ceph_assert(recovery_ops.count(op.hoid)); + eversion_t v = recovery_ops[op.hoid].v; + recovery_ops.erase(op.hoid); + get_parent()->on_failed_pull({get_parent()->whoami_shard()}, + op.hoid, v); + return; + } op.xattrs = op.obc->attr_cache; encode(*(op.hinfo), op.xattrs[ECUtil::get_hinfo_key()]); }