]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/d4n: fix to correctly populate rgw_obj of GetObjectState in
authorPritha Srivastava <prsrivas@redhat.com>
Wed, 8 May 2024 09:29:04 +0000 (14:59 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Mon, 21 Apr 2025 04:04:07 +0000 (09:34 +0530)
RGWRados, in case ReadOp::prepare() reads the head object from
the cache.

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
src/rgw/driver/d4n/rgw_sal_d4n.cc
src/rgw/driver/d4n/rgw_sal_d4n.h
src/rgw/driver/rados/rgw_rados.cc

index 55da49e81f4da4d36c0fbcdbece60c993822176b..9d45888d990838932f4338eede6ba2541ef3d8f6 100644 (file)
@@ -159,6 +159,7 @@ bool D4NFilterObject::get_obj_attrs_from_cache(const DoutPrefixProvider* dpp, op
   if (found_in_cache) {
     /* Set metadata locally */
 
+    ldpp_dout(dpp, 10) << "D4NFilterObject::" << __func__ << "(): obj is: " << this->get_obj().key.name << dendl;
     std::string instance;
     for (auto& attr : attrs) {
       if (attr.second.length() > 0) {
@@ -343,6 +344,8 @@ int D4NFilterObject::get_obj_attrs(optional_yield y, const DoutPrefixProvider* d
     }
   
     this->load_obj_state(dpp, y);
+    this->obj = this->get_obj();
+    ldpp_dout(dpp, 10) << "D4NFilterObject::" << __func__ << "(): this->obj is: " << this->obj.key.name << dendl;
     attrs = this->get_attrs();
     this->set_obj_state_attrs(dpp, y, attrs);
 
index 6788e1122d8a3645e28632c6bf9cc0536db83009..ca1c78497bf8fd225a681af26543dc9e13e99663 100644 (file)
@@ -105,6 +105,7 @@ class D4NFilterObject : public FilterObject {
     D4NFilterDriver* driver;
     std::string version;
     std::string prefix;
+    rgw_obj obj;
   public:
     struct D4NFilterReadOp : FilterReadOp {
       public:
index a2016dddf6c836efb500a50f0ba24851ae810dec..133b997b7c75a9d209cfa4342e14a0de8e814efc 100644 (file)
@@ -7944,6 +7944,10 @@ int RGWRados::Object::Read::iterate(const DoutPrefixProvider *dpp, int64_t ofs,
   auto aio = rgw::make_throttle(window_size, y);
   get_obj_data data(store, cb, &*aio, ofs, y);
 
+  if (state.obj.empty()) {
+    state.obj = source->get_obj();
+  }
+
   int r = store->iterate_obj(dpp, source->get_ctx(), source->get_bucket_info(), state.obj,
                              ofs, end, chunk_size, _get_obj_iterate_cb, &data, y);
   if (r < 0) {