]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/cloudtier : disable sync for cloud tier objects
authorJiffin Tony Thottan <thottanjiffin@gmail.com>
Wed, 30 Oct 2024 14:14:43 +0000 (19:44 +0530)
committerJiffin Tony Thottan <thottanjiffin@gmail.com>
Mon, 24 Feb 2025 10:47:28 +0000 (16:17 +0530)
Also modified the modify_obj_attr api to include flags similar to set_obj_attrs

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
16 files changed:
src/rgw/driver/d4n/rgw_sal_d4n.cc
src/rgw/driver/d4n/rgw_sal_d4n.h
src/rgw/driver/daos/rgw_sal_daos.cc
src/rgw/driver/daos/rgw_sal_daos.h
src/rgw/driver/motr/rgw_sal_motr.cc
src/rgw/driver/motr/rgw_sal_motr.h
src/rgw/driver/posix/rgw_sal_posix.cc
src/rgw/driver/posix/rgw_sal_posix.h
src/rgw/driver/rados/rgw_rados.cc
src/rgw/driver/rados/rgw_sal_rados.cc
src/rgw/driver/rados/rgw_sal_rados.h
src/rgw/rgw_sal.h
src/rgw/rgw_sal_dbstore.cc
src/rgw/rgw_sal_dbstore.h
src/rgw/rgw_sal_filter.cc
src/rgw/rgw_sal_filter.h

index 712cebbfc051feb0000c496ff15b6184b2a5732c..65145fb833bfb3dd046516fcd97c410bbe25f386 100644 (file)
@@ -206,7 +206,7 @@ int D4NFilterObject::get_obj_attrs(optional_yield y, const DoutPrefixProvider* d
 }
 
 int D4NFilterObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val,
-                               optional_yield y, const DoutPrefixProvider* dpp
+                               optional_yield y, const DoutPrefixProvider* dpp,  uint32_t flags)
 {
   Attrs update;
   update[(std::string)attr_name] = attr_val;
@@ -214,7 +214,7 @@ int D4NFilterObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_va
   if (driver->get_cache_driver()->update_attrs(dpp, this->get_key().get_oid(), update, y) < 0) 
     ldpp_dout(dpp, 10) << "D4NFilterObject::" << __func__ << "(): CacheDriver update_attrs method failed." << dendl;
 
-  return next->modify_obj_attrs(attr_name, attr_val, y, dpp);  
+  return next->modify_obj_attrs(attr_name, attr_val, y, dpp, flags);
 }
 
 int D4NFilterObject::delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr_name,
index e7d041d2a195a5ff9cd7ef03936ee5c9a2b3d553..2d852b33ecc3709c88233c91a09cb3dbf149e135 100644 (file)
@@ -183,7 +183,8 @@ class D4NFilterObject : public FilterObject {
     virtual int get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp,
                             rgw_obj* target_obj = NULL) override;
     virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val,
-                               optional_yield y, const DoutPrefixProvider* dpp) override;
+                               optional_yield y, const DoutPrefixProvider* dpp,
+                              uint32_t flags = rgw::sal::FLAG_LOG_OP) override;
     virtual int delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr_name,
                                optional_yield y) override;
     virtual ceph::real_time get_mtime(void) const override { return next->get_mtime(); };
index 9cd8c352267ff46889f1eae3485e4c3bb554ed10..c27cf19703c38a5074586841447700e17f597413 100644 (file)
@@ -930,7 +930,7 @@ int DaosObject::get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp,
 
 int DaosObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val,
                                  optional_yield y,
-                                 const DoutPrefixProvider* dpp) {
+                                 const DoutPrefixProvider* dpp, uint32_t flags) {
   // Get object's metadata (those stored in rgw_bucket_dir_entry)
   ldpp_dout(dpp, 20) << "DEBUG: modify_obj_attrs" << dendl;
   rgw_bucket_dir_entry ent;
index f7ab8a4e40e9e10bb189417cc1192ea9406eb23f..84aaf5a60f332bdf3db6bb7521b65ee8a9d4eee2 100644 (file)
@@ -625,7 +625,8 @@ class DaosObject : public StoreObject {
                             rgw_obj* target_obj = NULL) override;
   virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val,
                                optional_yield y,
-                               const DoutPrefixProvider* dpp) override;
+                               const DoutPrefixProvider* dpp,
+                               uint32_t flags = rgw::sal::FLAG_LOG_OP) override;
   virtual int delete_obj_attrs(const DoutPrefixProvider* dpp,
                                const char* attr_name,
                                optional_yield y) override;
index 98ddaf9dcb9d129bd6a06fd606d2a152eb0255a9..8361ecff83fa3b88c390b7875b5f3702ea8f933a 100644 (file)
@@ -1224,7 +1224,7 @@ int MotrObject::get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp, r
   return 0;
 }
 
-int MotrObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp)
+int MotrObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp, uint32_t flags)
 {
   rgw_obj target = get_obj();
   int r = get_obj_attrs(y, dpp, &target);
@@ -1233,7 +1233,7 @@ int MotrObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val, op
   }
   set_atomic();
   state.attrset[attr_name] = attr_val;
-  return set_obj_attrs(dpp, &state.attrset, nullptr, y, rgw::sal::FLAG_LOG_OP);
+  return set_obj_attrs(dpp, &state.attrset, nullptr, y, flags);
 }
 
 int MotrObject::delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr_name, optional_yield y)
index 19f66bf198612c3a2ee71a0e32e18c29b16e5ad2..2071d827e950869cc18cfcddc83db62712c83572 100644 (file)
@@ -680,7 +680,8 @@ class MotrObject : public StoreObject {
     virtual int load_obj_state(const DoutPrefixProvider* dpp, optional_yield y, bool follow_olh = true) override;
     virtual int set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs, Attrs* delattrs, optional_yield y, uint32_t flags) override;
     virtual int get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp, rgw_obj* target_obj = NULL) override;
-    virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp) override;
+    virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp,
+                                 uint32_t flags = rgw::sal::FLAG_LOG_OP) override;
     virtual int delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr_name, optional_yield y) override;
     virtual bool is_expired() override;
     virtual void gen_rand_obj_instance_name() override;
index 129be22b63283f8d8c7dd09991e4b2d566243672..205f9fb6c63a14828dc63c4d9ed7efcc806247e2 100644 (file)
@@ -2962,7 +2962,7 @@ int POSIXObject::get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp,
 }
 
 int POSIXObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val,
-                               optional_yield y, const DoutPrefixProvider* dpp)
+                               optional_yield y, const DoutPrefixProvider* dpp, uint32_t flags)
 {
   state.attrset[attr_name] = attr_val;
   return write_attrs(dpp, y);
index ac3e17ca93f5e88b69803170761fff922e430b95..06943814574662a221784d4e52eb6ca31cc11294 100644 (file)
@@ -668,7 +668,8 @@ public:
   virtual int get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp,
                            rgw_obj* target_obj = NULL) override;
   virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val,
-                              optional_yield y, const DoutPrefixProvider* dpp) override;
+                              optional_yield y, const DoutPrefixProvider* dpp,
+                              uint32_t flags = rgw::sal::FLAG_LOG_OP) override;
   virtual int delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr_name,
                               optional_yield y) override;
   virtual bool is_expired() override;
index 1e3ada948fe2df37e407b057b092969ed7c92008..94e7b2e5350a962f4a931c31029a52eb9a3a3823 100644 (file)
@@ -5377,6 +5377,9 @@ int RGWRados::restore_obj_from_cloud(RGWLCCloudTierCtx& tier_ctx,
       attrs[RGW_ATTR_CLOUD_TIER_CONFIG] = t_tier;
     }
 
+    // The temporary cloud restore object should not sync to other site
+    log_op = false;
+
   } else { // permanent restore
     {
       bufferlist bl;
@@ -5386,6 +5389,7 @@ int RGWRados::restore_obj_from_cloud(RGWLCCloudTierCtx& tier_ctx,
       attrs[RGW_ATTR_RESTORE_TYPE] = std::move(bl);
       ldpp_dout(dpp, 20) << "Permanent restore, object:" << dest_obj << dendl;
     }
+    log_op = true;
   }
 
   {
index b648741d6e79bce4db5e05a48e61c0d308f7fc79..54ccb75747c76a1c6f6da48fc519f5de3c23250b 100644 (file)
@@ -2679,7 +2679,7 @@ int RadosObject::get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp,
   return read_attrs(dpp, read_op, y, target_obj);
 }
 
-int RadosObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp)
+int RadosObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp, uint32_t flags)
 {
   rgw_obj target = get_obj();
   rgw_obj save = get_obj();
@@ -2692,7 +2692,7 @@ int RadosObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val, o
   state.obj = target;
   set_atomic();
   state.attrset[attr_name] = attr_val;
-  r = set_obj_attrs(dpp, &state.attrset, nullptr, y, rgw::sal::FLAG_LOG_OP);
+  r = set_obj_attrs(dpp, &state.attrset, nullptr, y, flags);
   /* Restore target */
   state.obj = save;
 
@@ -3073,8 +3073,7 @@ int RadosObject::set_cloud_restore_status(const DoutPrefixProvider* dpp,
   bufferlist bl;
   using ceph::encode;
   encode(restore_status, bl);
-
-  ret = modify_obj_attrs(RGW_ATTR_RESTORE_STATUS, bl, y, dpp);
+  ret = modify_obj_attrs(RGW_ATTR_RESTORE_STATUS, bl, y, dpp, false);
 
   return ret;
 }
@@ -3161,7 +3160,7 @@ int RadosObject::handle_obj_expiry(const DoutPrefixProvider* dpp, optional_yield
            attrs[RGW_ATTR_INTERNAL_MTIME] = std::move(bl);
          }
           const req_context rctx{dpp, y, nullptr};
-          return obj_op.write_meta(0, 0, attrs, rctx, head_obj->get_trace());
+          return obj_op.write_meta(0, 0, attrs, rctx, head_obj->get_trace(), false);
         } catch (const buffer::end_of_buffer&) {
           // ignore empty manifest; it's not cloud-tiered
         } catch (const std::exception& e) {
@@ -3250,6 +3249,7 @@ int RadosObject::write_cloud_tier(const DoutPrefixProvider* dpp,
   // erase restore attrs
   attrs.erase(RGW_ATTR_RESTORE_STATUS);
   attrs.erase(RGW_ATTR_RESTORE_TYPE);
+  attrs.erase(RGW_ATTR_RESTORE_TIME);
   attrs.erase(RGW_ATTR_RESTORE_EXPIRY_DATE);
   attrs.erase(RGW_ATTR_CLOUDTIER_STORAGE_CLASS);
 
index ab53c66d0cc0fdb516682a296f79e29ecf91fd2d..01ef1f142a2ba7ff4f1ae398bbfc8ac949f27725 100644 (file)
@@ -607,7 +607,8 @@ class RadosObject : public StoreObject {
 
     virtual int set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs, Attrs* delattrs, optional_yield y, uint32_t flags) override;
     virtual int get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp, rgw_obj* target_obj = NULL) override;
-    virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp) override;
+    virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp,
+                                 uint32_t flags = rgw::sal::FLAG_LOG_OP) override;
     virtual int delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr_name, optional_yield y) override;
     virtual bool is_expired() override;
     virtual void gen_rand_obj_instance_name() override;
index 9838516cd0968726bc65ac9e2d989af16cc7a655..c76c28b401a51906801a0e33be8093105c53ccef 100644 (file)
@@ -1221,7 +1221,8 @@ class Object {
     /** Get attributes for this object */
     virtual int get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp, rgw_obj* target_obj = NULL) = 0;
     /** Modify attributes for this object. */
-    virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp) = 0;
+    virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp,
+                                 uint32_t flags = rgw::sal::FLAG_LOG_OP) = 0;
     /** Delete attributes for this object */
     virtual int delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr_name, optional_yield y) = 0;
     /** Check to see if this object has expired */
index 28a3e1b4901ec2b73fcdfa2eb6babc4bd936f3ea..945d72fa40dd4e7d9ae3a9ffeb69d9720e8a4d79 100644 (file)
@@ -544,7 +544,7 @@ namespace rgw::sal {
     return read_attrs(dpp, read_op, y, target_obj);
   }
 
-  int DBObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp)
+  int DBObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp, uint32_t flags)
   {
     rgw_obj target = get_obj();
     int r = get_obj_attrs(y, dpp, &target);
@@ -553,7 +553,7 @@ namespace rgw::sal {
     }
     set_atomic();
     state.attrset[attr_name] = attr_val;
-    return set_obj_attrs(dpp, &state.attrset, nullptr, y, rgw::sal::FLAG_LOG_OP);
+    return set_obj_attrs(dpp, &state.attrset, nullptr, y, flags);
   }
 
   int DBObject::delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr_name, optional_yield y)
index 2530f3e9ff7b990d925d0213829899991a2c885c..66fa83b813d6fab3ac48837ff5971dc425c887e8 100644 (file)
@@ -563,7 +563,8 @@ protected:
 
       virtual int load_obj_state(const DoutPrefixProvider* dpp, optional_yield y, bool follow_olh = true) override;
       virtual int get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp, rgw_obj* target_obj = NULL) override;
-      virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp) override;
+      virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp,
+                                  uint32_t flags = rgw::sal::FLAG_LOG_OP) override;
       virtual int delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr_name, optional_yield y) override;
       virtual bool is_expired() override;
       virtual void gen_rand_obj_instance_name() override;
index 60fa37d3c843378f39a64e14bc88f9a6f1a43880..d20af0dca608e0591bcc05ce8d0d122662402b52 100644 (file)
@@ -1080,9 +1080,9 @@ int FilterObject::get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp,
 }
 
 int FilterObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val,
-                                  optional_yield y, const DoutPrefixProvider* dpp)
+                                  optional_yield y, const DoutPrefixProvider* dpp, uint32_t flags)
 {
-  return next->modify_obj_attrs(attr_name, attr_val, y, dpp);
+  return next->modify_obj_attrs(attr_name, attr_val, y, dpp, flags);
 }
 
 int FilterObject::delete_obj_attrs(const DoutPrefixProvider* dpp,
index 20278a6a10cf10c8896bd571c107de78eb6c8c05..c9e7cc21f14b78ee7d1bf24dcb7ac337be7d9b50 100644 (file)
@@ -801,7 +801,8 @@ public:
   virtual int get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp,
                            rgw_obj* target_obj = NULL) override;
   virtual int modify_obj_attrs(const char* attr_name, bufferlist& attr_val,
-                              optional_yield y, const DoutPrefixProvider* dpp) override;
+                              optional_yield y, const DoutPrefixProvider* dpp,
+                              uint32_t flags = rgw::sal::FLAG_LOG_OP) override;
   virtual int delete_obj_attrs(const DoutPrefixProvider* dpp, const char* attr_name,
                               optional_yield y) override;
   virtual bool is_expired() override;