From: Radoslaw Zarzynski Date: Tue, 6 Feb 2024 17:52:56 +0000 (+0000) Subject: fixup: ECRcoveryBackend don't goes to disk as well X-Git-Tag: v19.3.0~13^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6e453e2dc2cb4254bf4919cf87da5683173ca4e7;p=ceph.git fixup: ECRcoveryBackend don't goes to disk as well Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index e455c5062b74..13d1317f272c 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -130,7 +130,7 @@ ECBackend::ECBackend( : PGBackend(cct, pg, store, coll, ch), read_pipeline(cct, ec_impl, this->sinfo, get_parent()->get_eclistener()), rmw_pipeline(cct, ec_impl, this->sinfo, get_parent()->get_eclistener(), *this), - recovery_backend(cct, coll, ec_impl, this->sinfo, read_pipeline, unstable_hashinfo_registry, get_parent()), + recovery_backend(cct, coll, ec_impl, this->sinfo, read_pipeline, unstable_hashinfo_registry, get_parent(), this), ec_impl(ec_impl), sinfo(ec_impl->get_data_chunk_count(), stripe_width), unstable_hashinfo_registry(cct, ec_impl) { @@ -150,14 +150,16 @@ ECBackend::RecoveryBackend::RecoveryBackend( const ECUtil::stripe_info_t& sinfo, ReadPipeline& read_pipeline, UnstableHashInfoRegistry& unstable_hashinfo_registry, - ECListener* parent) + ECListener* parent, + ECBackend* ecbackend) : cct(cct), coll(coll), ec_impl(std::move(ec_impl)), sinfo(sinfo), read_pipeline(read_pipeline), unstable_hashinfo_registry(unstable_hashinfo_registry), - parent(parent) { + parent(parent), + ecbackend(ecbackend) { } PGBackend::RecoveryHandle *ECBackend::RecoveryBackend::open_recovery_op() @@ -575,8 +577,12 @@ void ECBackend::RecoveryBackend::continue_recovery_op( uint64_t amount = get_recovery_chunk_size(); if (op.recovery_progress.first && op.obc) { - /* We've got the attrs and the hinfo, might as well use them */ - op.hinfo = unstable_hashinfo_registry.get_hash_info(op.hoid, false, op.obc->attr_cache, op.obc->obs.oi.size); + if (auto [r, attrs, size] = ecbackend->get_attrs_n_size_from_disk(op.hoid); + r >= 0 || r == -ENOENT) { + op.hinfo = unstable_hashinfo_registry.get_hash_info(op.hoid, false, attrs, size); + } else { + derr << __func__ << ": can't stat-or-getattr on " << op.hoid << dendl; + } if (!op.hinfo) { derr << __func__ << ": " << op.hoid << " has inconsistent hinfo" << dendl; diff --git a/src/osd/ECBackend.h b/src/osd/ECBackend.h index db003f0adcb9..e61ec6a0cc5c 100644 --- a/src/osd/ECBackend.h +++ b/src/osd/ECBackend.h @@ -198,6 +198,7 @@ public: UnstableHashInfoRegistry& unstable_hashinfo_registry; // TODO: lay an interface down here ECListener* parent; + ECBackend* ecbackend; ECListener *get_parent() const { return parent; } const OSDMapRef& get_osdmap() const { return get_parent()->pgb_get_osdmap(); } @@ -212,7 +213,8 @@ public: const ECUtil::stripe_info_t& sinfo, ReadPipeline& read_pipeline, UnstableHashInfoRegistry& unstable_hashinfo_registry, - ECListener* parent); + ECListener* parent, + ECBackend* ecbackend); struct RecoveryOp { hobject_t hoid; eversion_t v; @@ -307,8 +309,9 @@ public: const ECUtil::stripe_info_t& sinfo, ReadPipeline& read_pipeline, UnstableHashInfoRegistry& unstable_hashinfo_registry, - Listener* parent) - : RecoveryBackend(cct, coll, std::move(ec_impl), sinfo, read_pipeline, unstable_hashinfo_registry, parent->get_eclistener()), + Listener* parent, + ECBackend* ecbackend) + : RecoveryBackend(cct, coll, std::move(ec_impl), sinfo, read_pipeline, unstable_hashinfo_registry, parent->get_eclistener(), ecbackend), parent(parent) { }