From ffd4d1c34abdfc56dd14402ddcdd0463ed343090 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Tue, 21 Sep 2021 11:26:21 +0100 Subject: [PATCH] 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 --- src/osd/ECBackend.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 5388391c4f0..d9d2b5ae1be 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()]); } -- 2.47.3