]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: don't crash in backfill due to inconsistent hash info
authorMykola Golub <mgolub@suse.com>
Tue, 21 Sep 2021 10:26:21 +0000 (11:26 +0100)
committerMykola Golub <mgolub@suse.com>
Tue, 21 Sep 2021 10:26:21 +0000 (11:26 +0100)
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 <mgolub@suse.com>
src/osd/ECBackend.cc

index 5388391c4f0d3310aa57bb28073923e055a5d841..d9d2b5ae1be73a42b538dcd1821e72b938ab107e 100644 (file)
@@ -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()]);
       }