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>
(cherry picked from commit
f060683a2d29fa4c7f20c6f5e20cae9ac23d4481)
*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);
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,