]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/sal: add dpp and optional_yield to lifecycle ops
authorCasey Bodley <cbodley@redhat.com>
Fri, 5 Jul 2024 18:37:55 +0000 (14:37 -0400)
committerCasey Bodley <cbodley@redhat.com>
Tue, 23 Jul 2024 12:46:10 +0000 (08:46 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
12 files changed:
src/rgw/driver/rados/rgw_bucket.cc
src/rgw/driver/rados/rgw_cr_tools.cc
src/rgw/driver/rados/rgw_sal_rados.cc
src/rgw/driver/rados/rgw_sal_rados.h
src/rgw/rgw_lc.cc
src/rgw/rgw_lc.h
src/rgw/rgw_op.cc
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 996de5f3c4d85ddecc4de1415a4ceea2657a964b..94d3066e5b5a63ff854be746d9da14afd18ae5f1 100644 (file)
@@ -2781,6 +2781,7 @@ public:
 class RGWMetadataHandlerPut_BucketInstance : public RGWMetadataHandlerPut_SObj
 {
   CephContext *cct;
+  optional_yield y;
   RGWBucketInstanceMetadataHandler *bihandler;
   RGWBucketInstanceMetadataObject *obj;
 public:
@@ -2790,7 +2791,7 @@ public:
                                        RGWMetadataObject *_obj, RGWObjVersionTracker& objv_tracker,
                                       optional_yield y,
                                        RGWMDLogSyncType type, bool from_remote_zone) : RGWMetadataHandlerPut_SObj(_handler, _op, entry, _obj, objv_tracker, y, type, from_remote_zone),
-                                       cct(_cct), bihandler(_handler) {
+                                       cct(_cct), y(y), bihandler(_handler) {
     obj = static_cast<RGWBucketInstanceMetadataObject *>(_obj);
 
     auto& bci = obj->get_bci();
@@ -2947,7 +2948,7 @@ int RGWMetadataHandlerPut_BucketInstance::put_post(const DoutPrefixProvider *dpp
     auto lc_it = bci.attrs.find(RGW_ATTR_LC);
     if (lc_it != bci.attrs.end()) {
       ldpp_dout(dpp, 20) << "set lc config for " << bci.info.bucket.name << dendl;
-      ret = lc->set_bucket_config(bucket.get(), bci.attrs, nullptr);
+      ret = lc->set_bucket_config(dpp, y, bucket.get(), bci.attrs, nullptr);
       if (ret < 0) {
              ldpp_dout(dpp, 0) << __func__ << " failed to set lc config for "
                        << bci.info.bucket.name
@@ -2957,7 +2958,7 @@ int RGWMetadataHandlerPut_BucketInstance::put_post(const DoutPrefixProvider *dpp
 
     } else {
       ldpp_dout(dpp, 20) << "remove lc config for " << bci.info.bucket.name << dendl;
-      ret = lc->remove_bucket_config(bucket.get(), bci.attrs, false /* cannot merge attrs */);
+      ret = lc->remove_bucket_config(dpp, y, bucket.get(), bci.attrs, false /* cannot merge attrs */);
       if (ret < 0) {
              ldpp_dout(dpp, 0) << __func__ << " failed to remove lc config for "
                        << bci.info.bucket.name
index a46ba1ac6e1236708c311806cfaaafe09964156f..f9543b55935490bd5bddc94dd330276e957d091e 100644 (file)
@@ -115,7 +115,7 @@ int RGWBucketLifecycleConfigCR::Request::_send_request(const DoutPrefixProvider
     return -EIO;
   }
 
-  int ret = lc->set_bucket_config(params.bucket,
+  int ret = lc->set_bucket_config(dpp, null_yield, params.bucket,
                                   params.bucket_attrs,
                                   &params.config);
   if (ret < 0) {
index aa63743a24938b9525537a31edda47fdfe7e853d..33e667ba974d92120f46a5745b6af84244c2f2d2 100644 (file)
@@ -370,7 +370,7 @@ int RadosBucket::remove(const DoutPrefixProvider* dpp,
   if (get_attrs().count(RGW_ATTR_LC)) {
     constexpr bool merge_attrs = false; // don't update xattrs, we're deleting
     (void) store->getRados()->get_lc()->remove_bucket_config(
-      this, get_attrs(), merge_attrs);
+      dpp, y, this, get_attrs(), merge_attrs);
   }
 
   // remove bucket-topic mapping
@@ -3604,7 +3604,8 @@ int LCRadosSerializer::try_lock(const DoutPrefixProvider *dpp, utime_t dur, opti
   return lock.lock_exclusive(ioctx, oid);
 }
 
-int RadosLifecycle::get_entry(const std::string& oid, const std::string& marker,
+int RadosLifecycle::get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                              const std::string& oid, const std::string& marker,
                              std::unique_ptr<LCEntry>* entry)
 {
   cls_rgw_lc_entry cls_entry;
@@ -3612,16 +3613,12 @@ int RadosLifecycle::get_entry(const std::string& oid, const std::string& marker,
   if (ret)
     return ret;
 
-  LCEntry* e;
-  e = new StoreLCEntry(cls_entry.bucket, cls_entry.start_time, cls_entry.status);
-  if (!e)
-    return -ENOMEM;
-
-  entry->reset(e);
+  *entry = std::make_unique<StoreLCEntry>(cls_entry.bucket, cls_entry.start_time, cls_entry.status);
   return 0;
 }
 
-int RadosLifecycle::get_next_entry(const std::string& oid, const std::string& marker,
+int RadosLifecycle::get_next_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                                   const std::string& oid, const std::string& marker,
                                   std::unique_ptr<LCEntry>* entry)
 {
   cls_rgw_lc_entry cls_entry;
@@ -3631,16 +3628,12 @@ int RadosLifecycle::get_next_entry(const std::string& oid, const std::string& ma
   if (ret)
     return ret;
 
-  LCEntry* e;
-  e = new StoreLCEntry(cls_entry.bucket, cls_entry.start_time, cls_entry.status);
-  if (!e)
-    return -ENOMEM;
-
-  entry->reset(e);
+  *entry = std::make_unique<StoreLCEntry>(cls_entry.bucket, cls_entry.start_time, cls_entry.status);
   return 0;
 }
 
-int RadosLifecycle::set_entry(const std::string& oid, LCEntry& entry)
+int RadosLifecycle::set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                              const std::string& oid, LCEntry& entry)
 {
   cls_rgw_lc_entry cls_entry;
 
@@ -3651,8 +3644,9 @@ int RadosLifecycle::set_entry(const std::string& oid, LCEntry& entry)
   return cls_rgw_lc_set_entry(*store->getRados()->get_lc_pool_ctx(), oid, cls_entry);
 }
 
-int RadosLifecycle::list_entries(const std::string& oid, const std::string& marker,
-                                uint32_t max_entries, std::vector<std::unique_ptr<LCEntry>>& entries)
+int RadosLifecycle::list_entries(const DoutPrefixProvider* dpp, optional_yield y,
+                                 const std::string& oid, const std::string& marker,
+                                 uint32_t max_entries, std::vector<std::unique_ptr<LCEntry>>& entries)
 {
   entries.clear();
 
@@ -3670,7 +3664,8 @@ int RadosLifecycle::list_entries(const std::string& oid, const std::string& mark
   return ret;
 }
 
-int RadosLifecycle::rm_entry(const std::string& oid, LCEntry& entry)
+int RadosLifecycle::rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                             const std::string& oid, LCEntry& entry)
 {
   cls_rgw_lc_entry cls_entry;
 
@@ -3681,23 +3676,20 @@ int RadosLifecycle::rm_entry(const std::string& oid, LCEntry& entry)
   return cls_rgw_lc_rm_entry(*store->getRados()->get_lc_pool_ctx(), oid, cls_entry);
 }
 
-int RadosLifecycle::get_head(const std::string& oid, std::unique_ptr<LCHead>* head)
+int RadosLifecycle::get_head(const DoutPrefixProvider* dpp, optional_yield y,
+                             const std::string& oid, std::unique_ptr<LCHead>* head)
 {
   cls_rgw_lc_obj_head cls_head;
   int ret = cls_rgw_lc_get_head(*store->getRados()->get_lc_pool_ctx(), oid, cls_head);
   if (ret)
     return ret;
 
-  LCHead* h;
-  h = new StoreLCHead(cls_head.start_date, cls_head.shard_rollover_date, cls_head.marker);
-  if (!h)
-    return -ENOMEM;
-
-  head->reset(h);
+  *head = std::make_unique<StoreLCHead>(cls_head.start_date, cls_head.shard_rollover_date, cls_head.marker);
   return 0;
 }
 
-int RadosLifecycle::put_head(const std::string& oid, LCHead& head)
+int RadosLifecycle::put_head(const DoutPrefixProvider* dpp, optional_yield y,
+                             const std::string& oid, LCHead& head)
 {
   cls_rgw_lc_obj_head cls_head;
 
index 6d4465093bcf4883f1cd72d2bae93d7601cc82ff..98d0bc9d0058eeaf5ea5cbb3c748a3b65d36c447 100644 (file)
@@ -875,15 +875,24 @@ public:
   RadosLifecycle(RadosStore* _st) : store(_st) {}
 
   using StoreLifecycle::get_entry;
-  virtual int get_entry(const std::string& oid, const std::string& marker, std::unique_ptr<LCEntry>* entry) override;
-  virtual int get_next_entry(const std::string& oid, const std::string& marker, std::unique_ptr<LCEntry>* entry) override;
-  virtual int set_entry(const std::string& oid, LCEntry& entry) override;
-  virtual int list_entries(const std::string& oid, const std::string& marker,
+  virtual int get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                        const std::string& oid, const std::string& marker,
+                        std::unique_ptr<LCEntry>* entry) override;
+  virtual int get_next_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                             const std::string& oid, const std::string& marker,
+                             std::unique_ptr<LCEntry>* entry) override;
+  virtual int set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                        const std::string& oid, LCEntry& entry) override;
+  virtual int list_entries(const DoutPrefixProvider* dpp, optional_yield y,
+                           const std::string& oid, const std::string& marker,
                           uint32_t max_entries,
                           std::vector<std::unique_ptr<LCEntry>>& entries) override;
-  virtual int rm_entry(const std::string& oid, LCEntry& entry) override;
-  virtual int get_head(const std::string& oid, std::unique_ptr<LCHead>* head) override;
-  virtual int put_head(const std::string& oid, LCHead& head) override;
+  virtual int rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                       const std::string& oid, LCEntry& entry) override;
+  virtual int get_head(const DoutPrefixProvider* dpp, optional_yield y,
+                       const std::string& oid, std::unique_ptr<LCHead>* head) override;
+  virtual int put_head(const DoutPrefixProvider* dpp, optional_yield y,
+                       const std::string& oid, LCHead& head) override;
   virtual std::unique_ptr<LCSerializer> get_serializer(const std::string& lock_name,
                                                       const std::string& oid,
                                                       const std::string& cookie) override;
index 0d510d6642d759e85a7e01f21a3a0aa4b8289e46..fb3002b0a388ede9321b1d927eb68e26bfe6461e 100644 (file)
@@ -1865,7 +1865,7 @@ int RGWLC::bucket_lc_post(int index, int max_lock_sec,
       /* XXXX are we SURE the only way result could == ENOENT is when
        * there is no such bucket?  It is currently the value returned
        * from bucket_lc_process(...) */
-      ret = sal_lc->rm_entry(obj_names[index],  entry);
+      ret = sal_lc->rm_entry(this, null_yield, obj_names[index], entry);
       if (ret < 0) {
         ldpp_dout(this, 0) << "RGWLC::bucket_lc_post() failed to remove entry "
             << obj_names[index] << dendl;
@@ -1877,7 +1877,7 @@ int RGWLC::bucket_lc_post(int index, int max_lock_sec,
       entry.set_status(lc_complete);
     }
 
-    ret = sal_lc->set_entry(obj_names[index],  entry);
+    ret = sal_lc->set_entry(this, null_yield, obj_names[index], entry);
     if (ret < 0) {
       ldpp_dout(this, 0) << "RGWLC::bucket_lc_post() failed to set entry on "
           << obj_names[index] << dendl;
@@ -1897,7 +1897,8 @@ int RGWLC::list_lc_progress(string& marker, uint32_t max_entries,
   progress_map.clear();
   for(; index < max_objs; index++, marker="") {
     vector<std::unique_ptr<rgw::sal::Lifecycle::LCEntry>> entries;
-    int ret = sal_lc->list_entries(obj_names[index], marker, max_entries, entries);
+    int ret = sal_lc->list_entries(this, null_yield, obj_names[index],
+                                   marker, max_entries, entries);
     if (ret < 0) {
       if (ret == -ENOENT) {
         ldpp_dout(this, 10) << __func__ << "() ignoring unfound lc object="
@@ -2052,7 +2053,8 @@ int RGWLC::process_bucket(int index, int max_lock_secs, LCWorker* worker,
   std::unique_lock<rgw::sal::LCSerializer> lock(
     *(serializer.get()), std::adopt_lock);
 
-  ret = sal_lc->get_entry(obj_names[index], bucket_entry_marker, &entry);
+  ret = sal_lc->get_entry(this, null_yield, obj_names[index],
+                          bucket_entry_marker, &entry);
   if (ret >= 0) {
     if (entry->get_status() == lc_processing) {
       if (expired_session(entry->get_start_time())) {
@@ -2081,7 +2083,7 @@ int RGWLC::process_bucket(int index, int max_lock_secs, LCWorker* worker,
                     << dendl;
 
   entry->set_status(lc_processing);
-  ret = sal_lc->set_entry(obj_names[index], *entry);
+  ret = sal_lc->set_entry(this, null_yield, obj_names[index], *entry);
   if (ret < 0) {
     ldpp_dout(this, 0) << "RGWLC::process_bucket() failed to set obj entry "
                       << obj_names[index] << entry->get_bucket() << entry->get_status()
@@ -2149,7 +2151,8 @@ inline int RGWLC::advance_head(const std::string& lc_shard,
   int ret{0};
   std::unique_ptr<rgw::sal::Lifecycle::LCEntry> next_entry;
 
-  ret = sal_lc->get_next_entry(lc_shard, entry.get_bucket(), &next_entry);
+  ret = sal_lc->get_next_entry(this, null_yield, lc_shard,
+                               entry.get_bucket(), &next_entry);
   if (ret < 0) {
     ldpp_dout(this, 0) << "RGWLC::process() failed to get obj entry "
                       << lc_shard << dendl;
@@ -2160,7 +2163,7 @@ inline int RGWLC::advance_head(const std::string& lc_shard,
   head.set_marker(next_entry->get_bucket());
   head.set_start_date(start_date);
 
-  ret = sal_lc->put_head(lc_shard, head);
+  ret = sal_lc->put_head(this, null_yield, lc_shard, head);
   if (ret < 0) {
     ldpp_dout(this, 0) << "RGWLC::process() failed to put head "
                       << lc_shard
@@ -2183,7 +2186,7 @@ inline int RGWLC::check_if_shard_done(const std::string& lc_shard,
        << lc_shard << " worker=" << worker_ix
        << dendl;
       head.set_shard_rollover_date(ceph_clock_now());
-      ret = sal_lc->put_head(lc_shard, head);
+      ret = sal_lc->put_head(this, null_yield, lc_shard, head);
       if (ret < 0) {
         ldpp_dout(this, 0) << "RGWLC::process() failed to put head "
                            << lc_shard
@@ -2261,7 +2264,7 @@ int RGWLC::process(int index, int max_lock_secs, LCWorker* worker,
     utime_t now = ceph_clock_now();
 
     /* preamble: find an inital bucket/marker */
-    ret = sal_lc->get_head(lc_shard, &head);
+    ret = sal_lc->get_head(this, null_yield, lc_shard, &head);
     if (ret < 0) {
       ldpp_dout(this, 0) << "RGWLC::process() failed to get obj head "
           << lc_shard << ", ret=" << ret << dendl;
@@ -2280,7 +2283,8 @@ int RGWLC::process(int index, int max_lock_secs, LCWorker* worker,
                         << dendl;
 
       vector<std::unique_ptr<rgw::sal::Lifecycle::LCEntry>> entries;
-      int ret = sal_lc->list_entries(lc_shard, head->get_marker(), 1, entries);
+      int ret = sal_lc->list_entries(this, null_yield, lc_shard,
+                                     head->get_marker(), 1, entries);
       if (ret < 0) {
        ldpp_dout(this, 0) << "RGWLC::process() sal_lc->list_entries(lc_shard, head.marker, 1, "
                           << "entries) returned error ret==" << ret << dendl;
@@ -2299,7 +2303,8 @@ int RGWLC::process(int index, int max_lock_secs, LCWorker* worker,
                         << dendl;
 
       /* fetches the entry pointed to by head.bucket */
-      ret = sal_lc->get_entry(lc_shard, head->get_marker(), &entry);
+      ret = sal_lc->get_entry(this, null_yield, lc_shard,
+                              head->get_marker(), &entry);
       if (ret == -ENOENT) {
         /* skip to next entry */
              std::unique_ptr<rgw::sal::Lifecycle::LCEntry> tmp_entry = sal_lc->get_entry();
@@ -2366,7 +2371,7 @@ int RGWLC::process(int index, int max_lock_secs, LCWorker* worker,
     entry->set_status(lc_processing);
     entry->set_start_time(now);
 
-    ret = sal_lc->set_entry(lc_shard, *entry);
+    ret = sal_lc->set_entry(this, null_yield, lc_shard, *entry);
     if (ret < 0) {
       ldpp_dout(this, 0) << "RGWLC::process() failed to set obj entry "
              << lc_shard << entry->get_bucket() << entry->get_status() << dendl;
@@ -2402,7 +2407,7 @@ int RGWLC::process(int index, int max_lock_secs, LCWorker* worker,
       /* XXXX are we SURE the only way result could == ENOENT is when
        * there is no such bucket?  It is currently the value returned
        * from bucket_lc_process(...) */
-      ret = sal_lc->rm_entry(lc_shard,  *entry);
+      ret = sal_lc->rm_entry(this, null_yield, lc_shard, *entry);
       if (ret < 0) {
         ldpp_dout(this, 0) << "RGWLC::process() failed to remove entry "
                           << lc_shard << " (nonfatal)"
@@ -2415,7 +2420,7 @@ int RGWLC::process(int index, int max_lock_secs, LCWorker* worker,
       } else {
         entry->set_status(lc_complete);
       }
-      ret = sal_lc->set_entry(lc_shard, *entry);
+      ret = sal_lc->set_entry(this, null_yield, lc_shard, *entry);
       if (ret < 0) {
         ldpp_dout(this, 0) << "RGWLC::process() failed to set entry on lc_shard="
                            << lc_shard << " entry=" << entry
@@ -2604,9 +2609,10 @@ static int guard_lc_modify(const DoutPrefixProvider *dpp,
   return ret;
 }
 
-int RGWLC::set_bucket_config(rgw::sal::Bucket* bucket,
-                         const rgw::sal::Attrs& bucket_attrs,
-                         RGWLifecycleConfiguration *config)
+int RGWLC::set_bucket_config(const DoutPrefixProvider* dpp, optional_yield y,
+                             rgw::sal::Bucket* bucket,
+                             const rgw::sal::Attrs& bucket_attrs,
+                             RGWLifecycleConfiguration *config)
 {
   int ret{0};
   rgw::sal::Attrs attrs = bucket_attrs;
@@ -2617,8 +2623,7 @@ int RGWLC::set_bucket_config(rgw::sal::Bucket* bucket,
     config->encode(lc_bl);
     attrs[RGW_ATTR_LC] = std::move(lc_bl);
 
-    ret =
-      bucket->merge_and_store_attrs(this, attrs, null_yield);
+    ret = bucket->merge_and_store_attrs(dpp, attrs, y);
     if (ret < 0) {
       return ret;
     }
@@ -2627,16 +2632,17 @@ int RGWLC::set_bucket_config(rgw::sal::Bucket* bucket,
   rgw_bucket& b = bucket->get_key();
 
 
-  ret = guard_lc_modify(this, driver, sal_lc.get(), b, cookie,
+  ret = guard_lc_modify(dpp, driver, sal_lc.get(), b, cookie,
                        [&](rgw::sal::Lifecycle* sal_lc, const string& oid,
                            rgw::sal::Lifecycle::LCEntry& entry) {
-    return sal_lc->set_entry(oid, entry);
+    return sal_lc->set_entry(dpp, y, oid, entry);
   });
 
   return ret;
 }
 
-int RGWLC::remove_bucket_config(rgw::sal::Bucket* bucket,
+int RGWLC::remove_bucket_config(const DoutPrefixProvider* dpp, optional_yield y,
+                                rgw::sal::Bucket* bucket,
                                 const rgw::sal::Attrs& bucket_attrs,
                                bool merge_attrs)
 {
@@ -2646,19 +2652,19 @@ int RGWLC::remove_bucket_config(rgw::sal::Bucket* bucket,
 
   if (merge_attrs) {
     attrs.erase(RGW_ATTR_LC);
-    ret = bucket->merge_and_store_attrs(this, attrs, null_yield);
+    ret = bucket->merge_and_store_attrs(dpp, attrs, y);
 
     if (ret < 0) {
-      ldpp_dout(this, 0) << "RGWLC::RGWDeleteLC() failed to set attrs on bucket="
+      ldpp_dout(dpp, 0) << "RGWLC::RGWDeleteLC() failed to set attrs on bucket="
                         << b.name << " returned err=" << ret << dendl;
       return ret;
     }
   }
 
-  ret = guard_lc_modify(this, driver, sal_lc.get(), b, cookie,
+  ret = guard_lc_modify(dpp, driver, sal_lc.get(), b, cookie,
                        [&](rgw::sal::Lifecycle* sal_lc, const string& oid,
                            rgw::sal::Lifecycle::LCEntry& entry) {
-    return sal_lc->rm_entry(oid, entry);
+    return sal_lc->rm_entry(dpp, y, oid, entry);
   });
 
   return ret;
@@ -2692,7 +2698,7 @@ int fix_lc_shard_entry(const DoutPrefixProvider *dpp,
   // 2. entry doesn't exist, which usually happens when reshard has happened prior to update and next LC process has already dropped the update
   // 3. entry exists matching the current bucket id which was after a reshard (needs to be updated to the marker)
   // We are not dropping the old marker here as that would be caught by the next LC process update
-  int ret = sal_lc->get_entry(lc_oid, bucket_lc_key, &entry);
+  int ret = sal_lc->get_entry(dpp, null_yield, lc_oid, bucket_lc_key, &entry);
   if (ret == 0) {
     ldpp_dout(dpp, 5) << "Entry already exists, nothing to do" << dendl;
     return ret; // entry is already existing correctly set to marker
@@ -2708,10 +2714,10 @@ int fix_lc_shard_entry(const DoutPrefixProvider *dpp,
 
     ret = guard_lc_modify(dpp,
       driver, sal_lc, bucket->get_key(), cookie,
-      [&lc_oid](rgw::sal::Lifecycle* slc,
+      [dpp, &lc_oid](rgw::sal::Lifecycle* slc,
                              const string& oid,
                              rgw::sal::Lifecycle::LCEntry& entry) {
-       return slc->set_entry(lc_oid, entry);
+       return slc->set_entry(dpp, null_yield, lc_oid, entry);
       });
 
   }
index 162b839efea724dac8545f635f1c67573c62a9b3..d53e14cee6539b85d2a72a7922a782967b197e90 100644 (file)
@@ -653,10 +653,12 @@ public:
   bool going_down();
   void start_processor();
   void stop_processor();
-  int set_bucket_config(rgw::sal::Bucket* bucket,
+  int set_bucket_config(const DoutPrefixProvider* dpp, optional_yield y,
+                        rgw::sal::Bucket* bucket,
                         const rgw::sal::Attrs& bucket_attrs,
                         RGWLifecycleConfiguration *config);
-  int remove_bucket_config(rgw::sal::Bucket* bucket,
+  int remove_bucket_config(const DoutPrefixProvider* dpp, optional_yield y,
+                           rgw::sal::Bucket* bucket,
                            const rgw::sal::Attrs& bucket_attrs,
                           bool merge_attrs = true);
 
index 31a74e183e63b9ba29206d1d0c051fd7e5e8501d..422fdc06f5e7f670ee2c8b53d1f00c6c94e7e2cd 100644 (file)
@@ -6090,7 +6090,8 @@ void RGWPutLC::execute(optional_yield y)
     return;
   }
 
-  op_ret = driver->get_rgwlc()->set_bucket_config(s->bucket.get(), s->bucket_attrs, &new_config);
+  op_ret = driver->get_rgwlc()->set_bucket_config(this, y, s->bucket.get(),
+                                                  s->bucket_attrs, &new_config);
   if (op_ret < 0) {
     return;
   }
@@ -6106,7 +6107,8 @@ void RGWDeleteLC::execute(optional_yield y)
     return;
   }
 
-  op_ret = driver->get_rgwlc()->remove_bucket_config(s->bucket.get(), s->bucket_attrs);
+  op_ret = driver->get_rgwlc()->remove_bucket_config(this, y, s->bucket.get(),
+                                                     s->bucket_attrs);
   if (op_ret < 0) {
     return;
   }
index 9bc23f2d0aed8c99dc3df5b03374fbb2530be457..8ddfb7f7c7dc287a5ff4b76370e6f09e9b4eae22 100644 (file)
@@ -1554,21 +1554,30 @@ public:
   /** Get an empty entry */
   virtual std::unique_ptr<LCEntry> get_entry() = 0;
   /** Get an entry matching the given marker */
-  virtual int get_entry(const std::string& oid, const std::string& marker, std::unique_ptr<LCEntry>* entry) = 0;
+  virtual int get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                        const std::string& oid, const std::string& marker,
+                        std::unique_ptr<LCEntry>* entry) = 0;
   /** Get the entry following the given marker */
-  virtual int get_next_entry(const std::string& oid, const std::string& marker, std::unique_ptr<LCEntry>* entry) = 0;
+  virtual int get_next_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                             const std::string& oid, const std::string& marker,
+                             std::unique_ptr<LCEntry>* entry) = 0;
   /** Store a modified entry in then backing store */
-  virtual int set_entry(const std::string& oid, LCEntry& entry) = 0;
+  virtual int set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                        const std::string& oid, LCEntry& entry) = 0;
   /** List all known entries */
-  virtual int list_entries(const std::string& oid, const std::string& marker,
+  virtual int list_entries(const DoutPrefixProvider* dpp, optional_yield y,
+                           const std::string& oid, const std::string& marker,
                           uint32_t max_entries,
                           std::vector<std::unique_ptr<LCEntry>>& entries) = 0;
   /** Remove an entry from the backing store */
-  virtual int rm_entry(const std::string& oid, LCEntry& entry) = 0;
+  virtual int rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                       const std::string& oid, LCEntry& entry) = 0;
   /** Get a head */
-  virtual int get_head(const std::string& oid, std::unique_ptr<LCHead>* head) = 0;
+  virtual int get_head(const DoutPrefixProvider* dpp, optional_yield y,
+                       const std::string& oid, std::unique_ptr<LCHead>* head) = 0;
   /** Store a modified head to the backing store */
-  virtual int put_head(const std::string& oid, LCHead& head) = 0;
+  virtual int put_head(const DoutPrefixProvider* dpp, optional_yield y,
+                       const std::string& oid, LCHead& head) = 0;
 
   /** Get a serializer for lifecycle */
   virtual std::unique_ptr<LCSerializer> get_serializer(const std::string& lock_name,
index cb62ebecceedeb81a78363bfb1a92c1ade5b7320..51627914db263e04444656f40950b487de9a7397 100644 (file)
@@ -1838,40 +1838,47 @@ namespace rgw::sal {
     return std::make_unique<DBLifecycle>(this);
   }
 
-  int DBLifecycle::get_entry(const std::string& oid, const std::string& marker,
-                             std::unique_ptr<LCEntry>* entry)
+  int DBLifecycle::get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                             const std::string& oid, const std::string& marker,
+                             std::unique_ptr<LCEntry>* entry)
   {
     return store->getDB()->get_entry(oid, marker, entry);
   }
 
-  int DBLifecycle::get_next_entry(const std::string& oid, const std::string& marker,
+  int DBLifecycle::get_next_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                                  const std::string& oid, const std::string& marker,
                                  std::unique_ptr<LCEntry>* entry)
   {
     return store->getDB()->get_next_entry(oid, marker, entry);
   }
 
-  int DBLifecycle::set_entry(const std::string& oid, LCEntry& entry)
+  int DBLifecycle::set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                             const std::string& oid, LCEntry& entry)
   {
     return store->getDB()->set_entry(oid, entry);
   }
 
-  int DBLifecycle::list_entries(const std::string& oid, const std::string& marker,
+  int DBLifecycle::list_entries(const DoutPrefixProvider* dpp, optional_yield y,
+                                const std::string& oid, const std::string& marker,
                                 uint32_t max_entries, vector<std::unique_ptr<LCEntry>>& entries)
   {
     return store->getDB()->list_entries(oid, marker, max_entries, entries);
   }
 
-  int DBLifecycle::rm_entry(const std::string& oid, LCEntry& entry)
+  int DBLifecycle::rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                            const std::string& oid, LCEntry& entry)
   {
     return store->getDB()->rm_entry(oid, entry);
   }
 
-  int DBLifecycle::get_head(const std::string& oid, std::unique_ptr<LCHead>* head)
+  int DBLifecycle::get_head(const DoutPrefixProvider* dpp, optional_yield y,
+                            const std::string& oid, std::unique_ptr<LCHead>* head)
   {
     return store->getDB()->get_head(oid, head);
   }
 
-  int DBLifecycle::put_head(const std::string& oid, LCHead& head)
+  int DBLifecycle::put_head(const DoutPrefixProvider* dpp, optional_yield y,
+                            const std::string& oid, LCHead& head)
   {
     return store->getDB()->put_head(oid, head);
   }
index 2dfc340315de78c3d9ab70d9e04fe9e61629b2b4..f163b874eb04cd9392b5e4852fd2bd12e06bd0c5 100644 (file)
@@ -45,15 +45,24 @@ public:
   DBLifecycle(DBStore* _st) : store(_st) {}
 
   using StoreLifecycle::get_entry;
-  virtual int get_entry(const std::string& oid, const std::string& marker, std::unique_ptr<LCEntry>* entry) override;
-  virtual int get_next_entry(const std::string& oid, const std::string& marker, std::unique_ptr<LCEntry>* entry) override;
-  virtual int set_entry(const std::string& oid, LCEntry& entry) override;
-  virtual int list_entries(const std::string& oid, const std::string& marker,
+  virtual int get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                        const std::string& oid, const std::string& marker,
+                        std::unique_ptr<LCEntry>* entry) override;
+  virtual int get_next_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                             const std::string& oid, const std::string& marker,
+                             std::unique_ptr<LCEntry>* entry) override;
+  virtual int set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                        const std::string& oid, LCEntry& entry) override;
+  virtual int list_entries(const DoutPrefixProvider* dpp, optional_yield y,
+                           const std::string& oid, const std::string& marker,
                           uint32_t max_entries,
                           std::vector<std::unique_ptr<LCEntry>>& entries) override;
-  virtual int rm_entry(const std::string& oid, LCEntry& entry) override;
-  virtual int get_head(const std::string& oid, std::unique_ptr<LCHead>* head) override;
-  virtual int put_head(const std::string& oid, LCHead& head) override;
+  virtual int rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                       const std::string& oid, LCEntry& entry) override;
+  virtual int get_head(const DoutPrefixProvider* dpp, optional_yield y,
+                       const std::string& oid, std::unique_ptr<LCHead>* head) override;
+  virtual int put_head(const DoutPrefixProvider* dpp, optional_yield y,
+                       const std::string& oid, LCHead& head) override;
   virtual std::unique_ptr<LCSerializer> get_serializer(const std::string& lock_name,
                                                       const std::string& oid,
                                                       const std::string& cookie) override;
index 8408620ba5c95c49a16cdcbeba13f9867dfa61f5..5afefa3d2582be32efa650eccee3348d994d1437 100644 (file)
@@ -1330,51 +1330,45 @@ std::unique_ptr<Lifecycle::LCEntry> FilterLifecycle::get_entry()
   return std::make_unique<FilterLCEntry>(std::move(e));
 }
 
-int FilterLifecycle::get_entry(const std::string& oid, const std::string& marker,
+int FilterLifecycle::get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                               const std::string& oid, const std::string& marker,
                               std::unique_ptr<LCEntry>* entry)
 {
   std::unique_ptr<LCEntry> ne;
-  int ret;
-
-  ret = next->get_entry(oid, marker, &ne);
+  int ret = next->get_entry(dpp, y, oid, marker, &ne);
   if (ret < 0)
     return ret;
 
-  LCEntry* e = new FilterLCEntry(std::move(ne));
-  entry->reset(e);
-
+  *entry = std::make_unique<FilterLCEntry>(std::move(ne));
   return 0;
 }
 
-int FilterLifecycle::get_next_entry(const std::string& oid, const std::string& marker,
+int FilterLifecycle::get_next_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                                    const std::string& oid, const std::string& marker,
                                    std::unique_ptr<LCEntry>* entry)
 {
   std::unique_ptr<LCEntry> ne;
-  int ret;
-
-  ret = next->get_next_entry(oid, marker, &ne);
+  int ret = next->get_next_entry(dpp, y, oid, marker, &ne);
   if (ret < 0)
     return ret;
 
-  LCEntry* e = new FilterLCEntry(std::move(ne));
-  entry->reset(e);
-
+  *entry = std::make_unique<FilterLCEntry>(std::move(ne));
   return 0;
 }
 
-int FilterLifecycle::set_entry(const std::string& oid, LCEntry& entry)
+int FilterLifecycle::set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                               const std::string& oid, LCEntry& entry)
 {
-  return next->set_entry(oid, entry);
+  return next->set_entry(dpp, y, oid, entry);
 }
 
-int FilterLifecycle::list_entries(const std::string& oid, const std::string& marker,
+int FilterLifecycle::list_entries(const DoutPrefixProvider* dpp, optional_yield y,
+                                  const std::string& oid, const std::string& marker,
                                  uint32_t max_entries,
                                  std::vector<std::unique_ptr<LCEntry>>& entries)
 {
   std::vector<std::unique_ptr<LCEntry>> ne;
-  int ret;
-
-  ret = next->list_entries(oid, marker, max_entries, ne);
+  int ret = next->list_entries(dpp, y, oid, marker, max_entries, ne);
   if (ret < 0)
     return ret;
 
@@ -1385,29 +1379,28 @@ int FilterLifecycle::list_entries(const std::string& oid, const std::string& mar
   return 0;
 }
 
-int FilterLifecycle::rm_entry(const std::string& oid, LCEntry& entry)
+int FilterLifecycle::rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                              const std::string& oid, LCEntry& entry)
 {
-  return next->rm_entry(oid, entry);
+  return next->rm_entry(dpp, y, oid, entry);
 }
 
-int FilterLifecycle::get_head(const std::string& oid, std::unique_ptr<LCHead>* head)
+int FilterLifecycle::get_head(const DoutPrefixProvider* dpp, optional_yield y,
+                              const std::string& oid, std::unique_ptr<LCHead>* head)
 {
   std::unique_ptr<LCHead> nh;
-  int ret;
-
-  ret = next->get_head(oid, &nh);
+  int ret = next->get_head(dpp, y, oid, &nh);
   if (ret < 0)
     return ret;
 
-  LCHead* h = new FilterLCHead(std::move(nh));
-  head->reset(h);
-
+  *head = std::make_unique<FilterLCHead>(std::move(nh));
   return 0;
 }
 
-int FilterLifecycle::put_head(const std::string& oid, LCHead& head)
+int FilterLifecycle::put_head(const DoutPrefixProvider* dpp, optional_yield y,
+                              const std::string& oid, LCHead& head)
 {
-  return next->put_head(oid, *(dynamic_cast<FilterLCHead&>(head).next.get()));
+  return next->put_head(dpp, y, oid, *(dynamic_cast<FilterLCHead&>(head).next.get()));
 }
 
 std::unique_ptr<LCSerializer> FilterLifecycle::get_serializer(
index 664b37fa6a9dd7fee6d570c1ed9808eb9941ad16..fc2e3aeffa3743a1c8a98d95c96f3202c56ca493 100644 (file)
@@ -1004,17 +1004,24 @@ public:
   virtual ~FilterLifecycle() = default;
 
   virtual std::unique_ptr<LCEntry> get_entry() override;
-  virtual int get_entry(const std::string& oid, const std::string& marker,
+  virtual int get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                        const std::string& oid, const std::string& marker,
                        std::unique_ptr<LCEntry>* entry) override;
-  virtual int get_next_entry(const std::string& oid, const std::string& marker,
+  virtual int get_next_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                             const std::string& oid, const std::string& marker,
                             std::unique_ptr<LCEntry>* entry) override;
-  virtual int set_entry(const std::string& oid, LCEntry& entry) override;
-  virtual int list_entries(const std::string& oid, const std::string& marker,
+  virtual int set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                        const std::string& oid, LCEntry& entry) override;
+  virtual int list_entries(const DoutPrefixProvider* dpp, optional_yield y,
+                           const std::string& oid, const std::string& marker,
                           uint32_t max_entries,
                           std::vector<std::unique_ptr<LCEntry>>& entries) override;
-  virtual int rm_entry(const std::string& oid, LCEntry& entry) override;
-  virtual int get_head(const std::string& oid, std::unique_ptr<LCHead>* head) override;
-  virtual int put_head(const std::string& oid, LCHead& head) override;
+  virtual int rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+                       const std::string& oid, LCEntry& entry) override;
+  virtual int get_head(const DoutPrefixProvider* dpp, optional_yield y,
+                       const std::string& oid, std::unique_ptr<LCHead>* head) override;
+  virtual int put_head(const DoutPrefixProvider* dpp, optional_yield y,
+                       const std::string& oid, LCHead& head) override;
   virtual std::unique_ptr<LCSerializer> get_serializer(const std::string& lock_name,
                                                       const std::string& oid,
                                                       const std::string& cookie) override;