]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: get attribute for ec return wrong value for non-exist object 47332/head
authorNitzanMordhai <nmordech@redhat.com>
Thu, 28 Jul 2022 12:10:15 +0000 (12:10 +0000)
committerNitzanMordhai <nmordech@redhat.com>
Wed, 10 Aug 2022 14:19:04 +0000 (14:19 +0000)
In case of copy object when the target copy is not exist with erasure code pool
getattr_maybe_cache will return ENODATA that will cause ref_count to wildcard tag
that can affect pglog to grow quickly with refcounts for each copy

Fixes: https://tracker.ceph.com/issues/56707
Signed-off-by: Nitzan Mordechai <nmordec@redhat.com>
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 47265c169334e454995ce21c0237a25a76bc0fb5..4efab206212139bd8af4d49f29f24f70b6efe897 100644 (file)
@@ -15751,7 +15751,11 @@ int PrimaryLogPG::getattr_maybe_cache(
        *val = i->second;
       return 0;
     } else {
-      return -ENODATA;
+      if (obc->obs.exists) {
+        return -ENODATA;
+      } else {
+        return -ENOENT;
+      }
     }
   }
   return pgbackend->objects_get_attr(obc->obs.oi.soid, key, val);
index 28e6bdf329bcaea8df75bc417d368e9ec5df5ed7..808ab411440a4398ecdbad10fd4d49d1370610df 100644 (file)
@@ -1915,6 +1915,13 @@ public:
     ObjectContextRef obc,
     PGTransaction *t,
     const std::string &key);
+  /** 
+   * getattr_maybe_cache 
+   *
+   * Populates val (if non-null) with the value of the attr with the specified key. 
+   * Returns -ENOENT if object does not exist, -ENODATA if the object exists, 
+   * but the specified key does not. 
+   */
   int getattr_maybe_cache(
     ObjectContextRef obc,
     const std::string &key,