]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fixup: ECRcoveryBackend don't goes to disk as well
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 6 Feb 2024 17:52:56 +0000 (17:52 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 6 Feb 2024 17:53:16 +0000 (17:53 +0000)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/osd/ECBackend.cc
src/osd/ECBackend.h

index e455c5062b74ebc87c27c1057fc5266f43cbda3d..13d1317f272cd404e4a50206e1a71b60e77dbe1d 100644 (file)
@@ -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;
index db003f0adcb9249f5d8b0fbab904317cabd62d8b..e61ec6a0cc5c8094f486f4de29de46ec79656002 100644 (file)
@@ -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) {
     }