]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/sal: get_notification() takes optional_yield
authorCasey Bodley <cbodley@redhat.com>
Fri, 9 Dec 2022 18:46:14 +0000 (13:46 -0500)
committerCasey Bodley <cbodley@redhat.com>
Mon, 12 Dec 2022 16:46:00 +0000 (11:46 -0500)
Fixes: https://tracker.ceph.com/issues/58231
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_sal_rados.cc
src/rgw/driver/rados/rgw_sal_rados.h
src/rgw/rgw_op.cc
src/rgw/rgw_sal.h
src/rgw/rgw_sal_daos.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
src/rgw/rgw_sal_motr.h

index 577569dd5d5585caa7a89f5cb794a6310b60cb6f..4bfd80e9ff82d52028b27b427b4ac2eea74181a6 100644 (file)
@@ -1273,9 +1273,9 @@ std::unique_ptr<Completions> RadosStore::get_completions(void)
 }
 
 std::unique_ptr<Notification> RadosStore::get_notification(
-  rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s, rgw::notify::EventType event_type, const std::string* object_name)
+  rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s, rgw::notify::EventType event_type, optional_yield y, const std::string* object_name)
 {
-  return std::make_unique<RadosNotification>(s, this, obj, src_obj, s, event_type, object_name);
+  return std::make_unique<RadosNotification>(s, this, obj, src_obj, s, event_type, y, object_name);
 }
 
 std::unique_ptr<Notification> RadosStore::get_notification(const DoutPrefixProvider* dpp, rgw::sal::Object* obj, rgw::sal::Object* src_obj, rgw::notify::EventType event_type, rgw::sal::Bucket* _bucket, std::string& _user_id, std::string& _user_tenant, std::string& _req_id, optional_yield y)
index 58b662321fad73653bf4a6f955bb8e621b056823..37713d28f37b761db62a6aa3ef5752684e06328b 100644 (file)
@@ -164,7 +164,7 @@ class RadosStore : public StoreDriver {
     virtual int cluster_stat(RGWClusterStat& stats) override;
     virtual std::unique_ptr<Lifecycle> get_lifecycle(void) override;
     virtual std::unique_ptr<Completions> get_completions(void) override;
-    virtual std::unique_ptr<Notification> get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s, rgw::notify::EventType event_type, const std::string* object_name=nullptr) override;
+    virtual std::unique_ptr<Notification> get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s, rgw::notify::EventType event_type, optional_yield y, const std::string* object_name=nullptr) override;
     virtual std::unique_ptr<Notification> get_notification(
     const DoutPrefixProvider* dpp, rgw::sal::Object* obj, rgw::sal::Object* src_obj, 
     rgw::notify::EventType event_type, rgw::sal::Bucket* _bucket, std::string& _user_id, std::string& _user_tenant,
@@ -746,8 +746,8 @@ class RadosNotification : public StoreNotification {
   rgw::notify::reservation_t res;
 
   public:
-    RadosNotification(const DoutPrefixProvider* _dpp, RadosStore* _store, Object* _obj, Object* _src_obj, req_state* _s, rgw::notify::EventType _type, const std::string* object_name=nullptr) :
-      StoreNotification(_obj, _src_obj, _type), store(_store), res(_dpp, _store, _s, _obj, _src_obj, object_name, _s->yield) { }
+    RadosNotification(const DoutPrefixProvider* _dpp, RadosStore* _store, Object* _obj, Object* _src_obj, req_state* _s, rgw::notify::EventType _type, optional_yield y, const std::string* object_name) :
+      StoreNotification(_obj, _src_obj, _type), store(_store), res(_dpp, _store, _s, _obj, _src_obj, object_name, y) { }
 
     RadosNotification(const DoutPrefixProvider* _dpp, RadosStore* _store, Object* _obj, Object* _src_obj, rgw::notify::EventType _type, rgw::sal::Bucket* _bucket, std::string& _user_id, std::string& _user_tenant, std::string& _req_id, optional_yield y) :
       StoreNotification(_obj, _src_obj, _type), store(_store), res(_dpp, _store, _obj, _src_obj, _bucket, _user_id, _user_tenant, _req_id, y) {}
index 29552560b27cb82dafa109f960a0a5dc927bfe50..ecb25f6d208ce37e1e936aba8a4c6a714502e6c5 100644 (file)
@@ -3969,7 +3969,7 @@ void RGWPutObj::execute(optional_yield y)
   std::unique_ptr<rgw::sal::Notification> res
                     = driver->get_notification(
                       s->object.get(), s->src_object.get(), s,
-                      rgw::notify::ObjectCreatedPut);
+                      rgw::notify::ObjectCreatedPut, y);
   if(!multipart) {
     op_ret = res->publish_reserve(this, obj_tags.get());
     if (op_ret < 0) {
@@ -4377,7 +4377,7 @@ void RGWPostObj::execute(optional_yield y)
 
   // make reservation for notification if needed
   std::unique_ptr<rgw::sal::Notification> res
-    = driver->get_notification(s->object.get(), s->src_object.get(), s, rgw::notify::ObjectCreatedPost);
+    = driver->get_notification(s->object.get(), s->src_object.get(), s, rgw::notify::ObjectCreatedPost, y);
   op_ret = res->publish_reserve(this);
   if (op_ret < 0) {
     return;
@@ -5062,7 +5062,7 @@ void RGWDeleteObj::execute(optional_yield y)
       rgw::notify::ObjectRemovedDelete;
     std::unique_ptr<rgw::sal::Notification> res
       = driver->get_notification(s->object.get(), s->src_object.get(), s,
-                               event_type);
+                               event_type, y);
     op_ret = res->publish_reserve(this);
     if (op_ret < 0) {
       return;
@@ -5466,7 +5466,7 @@ void RGWCopyObj::execute(optional_yield y)
   std::unique_ptr<rgw::sal::Notification> res
                                   = driver->get_notification(
                                     s->object.get(), s->src_object.get(),
-                                    s, rgw::notify::ObjectCreatedCopy);
+                                    s, rgw::notify::ObjectCreatedCopy, y);
   op_ret = res->publish_reserve(this);
   if (op_ret < 0) {
     return;
@@ -6430,7 +6430,7 @@ void RGWCompleteMultipart::execute(optional_yield y)
 
   // make reservation for notification if needed
   std::unique_ptr<rgw::sal::Notification> res
-    = driver->get_notification(meta_obj.get(), nullptr, s, rgw::notify::ObjectCreatedCompleteMultipartUpload, &s->object->get_name());
+    = driver->get_notification(meta_obj.get(), nullptr, s, rgw::notify::ObjectCreatedCompleteMultipartUpload, y, &s->object->get_name());
   op_ret = res->publish_reserve(this);
   if (op_ret < 0) {
     return;
@@ -6964,7 +6964,7 @@ void RGWDeleteMultiObj::handle_individual_object(const rgw_obj_key& o, optional_
                           rgw::notify::ObjectRemovedDeleteMarkerCreated :
                           rgw::notify::ObjectRemovedDelete;
   std::unique_ptr<rgw::sal::Notification> res
-          = driver->get_notification(obj.get(), s->src_object.get(), s, event_type);
+          = driver->get_notification(obj.get(), s->src_object.get(), s, event_type, y);
   op_ret = res->publish_reserve(this);
   if (op_ret < 0) {
     send_partial_response(o, false, "", op_ret, formatter_flush_cond);
index 1a24045adf184de42e00fa40707163fe60d1d0e1..bae96e2cddcb7bfdfcca9b10c313f78f0ecbbc21 100644 (file)
@@ -330,7 +330,7 @@ class Driver {
       * management/tracking software */
     /** RGWOp variant */
     virtual std::unique_ptr<Notification> get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s,
-        rgw::notify::EventType event_type, const std::string* object_name=nullptr) = 0;
+        rgw::notify::EventType event_type, optional_yield y, const std::string* object_name=nullptr) = 0;
     /** No-req_state variant (e.g., rgwlc) */
     virtual std::unique_ptr<Notification> get_notification(
     const DoutPrefixProvider* dpp, rgw::sal::Object* obj, rgw::sal::Object* src_obj, 
index f172a8abe3bf9c3775f0fd932e0fecc978123070..e94d584374aba148385ba2092c974637e76cfc87 100644 (file)
@@ -935,7 +935,7 @@ class DaosStore : public StoreDriver {
   virtual std::unique_ptr<Completions> get_completions(void) override;
   virtual std::unique_ptr<Notification> get_notification(
       rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct req_state* s,
-      rgw::notify::EventType event_type,
+      rgw::notify::EventType event_type, optional_yield y,
       const std::string* object_name = nullptr) override;
   virtual std::unique_ptr<Notification> get_notification(
       const DoutPrefixProvider* dpp, rgw::sal::Object* obj,
index a99a412d4dd504b2aedc9f0395810c83973f6810..c16096b761a3e92b1d0f1da932c02581b997f8da 100644 (file)
@@ -1826,7 +1826,8 @@ namespace rgw::sal {
 
   std::unique_ptr<Notification> DBStore::get_notification(
     rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s,
-    rgw::notify::EventType event_type, const std::string* object_name)
+    rgw::notify::EventType event_type, optional_yield y,
+    const std::string* object_name)
   {
     return std::make_unique<DBNotification>(obj, src_obj, event_type);
   }
index a7f496191c73fb216393f61223e2c3096193f6c2..24ba6bb964d6102177f321bf59ee15686d910494 100644 (file)
@@ -814,7 +814,7 @@ public:
 
   virtual std::unique_ptr<Notification> get_notification(
     rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s,
-    rgw::notify::EventType event_type, const std::string* object_name) override;
+    rgw::notify::EventType event_type, optional_yield y, const std::string* object_name) override;
 
   virtual std::unique_ptr<Notification> get_notification(
     const DoutPrefixProvider* dpp, rgw::sal::Object* obj,
index ba5ed02322708fa9aead846947c1201606bbb5fe..923b89dd23e4be04a61a87221cd8a041885a2dd8 100644 (file)
@@ -275,12 +275,12 @@ std::unique_ptr<Completions> FilterDriver::get_completions(void)
 
 std::unique_ptr<Notification> FilterDriver::get_notification(rgw::sal::Object* obj,
                                rgw::sal::Object* src_obj, req_state* s,
-                               rgw::notify::EventType event_type,
+                               rgw::notify::EventType event_type, optional_yield y,
                                const std::string* object_name)
 {
   std::unique_ptr<Notification> n = next->get_notification(nextObject(obj),
                                                           nextObject(src_obj),
-                                                          s, event_type,
+                                                          s, event_type, y,
                                                           object_name);
   return std::make_unique<FilterNotification>(std::move(n));
 }
index 88bd81ee10d9e796c730352115ae21bdf50f047d..df44ea70157b4c0f979e6143422a9f4c7a2dc6a9 100644 (file)
@@ -202,7 +202,7 @@ public:
 
   virtual std::unique_ptr<Notification> get_notification(rgw::sal::Object* obj,
                                 rgw::sal::Object* src_obj, struct req_state* s,
-                                rgw::notify::EventType event_type,
+                                rgw::notify::EventType event_type, optional_yield y,
                                 const std::string* object_name=nullptr) override;
   virtual std::unique_ptr<Notification> get_notification(
     const DoutPrefixProvider* dpp, rgw::sal::Object* obj, rgw::sal::Object* src_obj, 
index ad9328b95197502efdaa2b5820d982570caa95d7..aab47acaa5bc240420be310aea58d21b2f60030a 100644 (file)
@@ -953,7 +953,7 @@ class MotrStore : public StoreDriver {
     virtual std::unique_ptr<Lifecycle> get_lifecycle(void) override;
     virtual std::unique_ptr<Completions> get_completions(void) override;
     virtual std::unique_ptr<Notification> get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj,
-        req_state* s, rgw::notify::EventType event_type, const std::string* object_name=nullptr) override;
+        req_state* s, rgw::notify::EventType event_type, optional_yield y, const std::string* object_name=nullptr) override;
     virtual std::unique_ptr<Notification> get_notification(const DoutPrefixProvider* dpp, rgw::sal::Object* obj,
         rgw::sal::Object* src_obj, rgw::notify::EventType event_type, rgw::sal::Bucket* _bucket,
         std::string& _user_id, std::string& _user_tenant, std::string& _req_id, optional_yield y) override;