From: Pritha Srivastava Date: Thu, 22 May 2025 04:20:50 +0000 (+0530) Subject: rgw/d4n: avoid reading head block (attrs) from cache, X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8e5de45da5ad948c7231270783bcadefe138b97e;p=ceph.git rgw/d4n: avoid reading head block (attrs) from cache, if they have already been read while reading permissions for an object. Signed-off-by: Pritha Srivastava --- diff --git a/src/rgw/driver/d4n/rgw_sal_d4n.cc b/src/rgw/driver/d4n/rgw_sal_d4n.cc index c1d3701baf597..3995e5e6f19d5 100644 --- a/src/rgw/driver/d4n/rgw_sal_d4n.cc +++ b/src/rgw/driver/d4n/rgw_sal_d4n.cc @@ -897,6 +897,11 @@ int D4NFilterObject::set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattr int D4NFilterObject::get_obj_attrs_from_cache(const DoutPrefixProvider* dpp, optional_yield y) { + //if attrs have already been set due to a previous call, do not read again. + if (attrs_read_from_cache) { + return true; + } + std::string head_oid_in_cache; rgw::sal::Attrs attrs; rgw::d4n::CacheBlock block; @@ -957,6 +962,7 @@ int D4NFilterObject::get_obj_attrs_from_cache(const DoutPrefixProvider* dpp, opt if (ret < 0) { ldpp_dout(dpp, 0) << "D4NFilterObject::" << __func__ << "(): D4NFilterObject set_attrs method failed." << dendl; } + attrs_read_from_cache = true; } // if found_in_cache = true return found_in_cache; diff --git a/src/rgw/driver/d4n/rgw_sal_d4n.h b/src/rgw/driver/d4n/rgw_sal_d4n.h index 8511e03554de3..b0ae4754db189 100644 --- a/src/rgw/driver/d4n/rgw_sal_d4n.h +++ b/src/rgw/driver/d4n/rgw_sal_d4n.h @@ -138,6 +138,7 @@ class D4NFilterObject : public FilterObject { bool delete_marker{false}; bool exists_in_cache{false}; bool load_from_store{false}; + bool attrs_read_from_cache{false}; public: struct D4NFilterReadOp : FilterReadOp {