]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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)
committerCory Snyder <csnyder@1111systems.com>
Fri, 24 Feb 2023 09:35:26 +0000 (04:35 -0500)
Fixes: https://tracker.ceph.com/issues/58231
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 41b402fe9428e56bbbf7a9055837c78ae90d607a)

Conflicts:
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
src/rgw/rgw_sal_rados.cc
src/rgw/rgw_sal_rados.h

Cherry-pick notes:
- rgw_op.cc: member variable was renamed from store to driver
- rgw_sal.h: get_notification req_state param previously had struct keyword
- rgw_sal_dbstore.cc: get_notification req_state param previously had struct keyword
- rgw_sal_dbstore.h: get_notification req_state param previously had struct keyword
- rgw_sal_rados.cc: get_notification req_state param previously had struct keyword
- rgw_sal_rados.h: Notification was renamed to StoreNotification
- rgw_sal_motr.h: did not exist in Quincy release
- rgw_sal_filter.cc/.h: did not exist in Quincy release
- rgw_sal_daos.h: did not exist in Quincy release

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_rados.cc
src/rgw/rgw_sal_rados.h

index 3cfac33c54492107998c995c37de3bcc3d6f4ea9..727dc1b257b7d78114d24bb7b106bc4c50a06cb7 100644 (file)
@@ -3913,7 +3913,7 @@ void RGWPutObj::execute(optional_yield y)
   std::unique_ptr<rgw::sal::Notification> res
                     = store->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) {
@@ -4313,7 +4313,7 @@ void RGWPostObj::execute(optional_yield y)
 
   // make reservation for notification if needed
   std::unique_ptr<rgw::sal::Notification> res
-    = store->get_notification(s->object.get(), s->src_object.get(), s, rgw::notify::ObjectCreatedPost);
+    = store->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;
@@ -5003,7 +5003,7 @@ void RGWDeleteObj::execute(optional_yield y)
       rgw::notify::ObjectRemovedDelete;
     std::unique_ptr<rgw::sal::Notification> res
       = store->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;
@@ -5406,7 +5406,7 @@ void RGWCopyObj::execute(optional_yield y)
   std::unique_ptr<rgw::sal::Notification> res
                                   = store->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;
@@ -6371,7 +6371,7 @@ void RGWCompleteMultipart::execute(optional_yield y)
 
   // make reservation for notification if needed
   std::unique_ptr<rgw::sal::Notification> res
-    = store->get_notification(meta_obj.get(), nullptr, s, rgw::notify::ObjectCreatedCompleteMultipartUpload, &s->object->get_name());
+    = store->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;
@@ -6908,7 +6908,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
-    = store->get_notification(obj.get(), s->src_object.get(), s, event_type);
+    = store->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 9d02cbbfdf501bc914e514f411b6580eb72423e7..4c482c55cb3f6bb35722b328723345d8622140c2 100644 (file)
@@ -289,7 +289,7 @@ class Store {
       * management/tracking software */
     /** RGWOp variant */
     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, 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, RGWObjectCtx* rctx,
index f646d94357dfa1aaa3170be62518108dadc6eb67..5418a648e5b8ada49668b2d2f37234d60ef71dda 100644 (file)
@@ -1750,7 +1750,8 @@ namespace rgw::sal {
 
   std::unique_ptr<Notification> DBStore::get_notification(
     rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct 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 49c1bc4340bc24e8bcc5d2bb1507495d7b7a5ae8..77c4af5d29dee978a780694509ab81e7e89fff1b 100644 (file)
@@ -717,7 +717,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, 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 8c9f9ef031b7da6dc24178d7f3b3e4a215593efa..80a0e04107a4ba60accfa983f780ffab286e2ffd 100644 (file)
@@ -1159,9 +1159,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, struct req_state* s, rgw::notify::EventType event_type, const std::string* object_name)
+  rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct 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, RGWObjectCtx* rctx, 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 3c97e18016bcbef1cb991b33196dccad44d50701..e766fbb5ae4a00341009a1d125c0b2c285e82964 100644 (file)
@@ -399,7 +399,7 @@ class RadosStore : public Store {
     virtual std::unique_ptr<Completions> get_completions(void) override;
 
     // op variant
-    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, const std::string* object_name=nullptr) 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, optional_yield y, const std::string* object_name=nullptr) override;
 
     // non-op variant (e.g., rgwlc)
     virtual std::unique_ptr<Notification> get_notification(const DoutPrefixProvider* dpp, rgw::sal::Object* obj, rgw::sal::Object* src_obj, RGWObjectCtx* rctx, 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;
@@ -623,8 +623,8 @@ class RadosNotification : public Notification {
   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) :
-      Notification(_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) :
+      Notification(_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, RGWObjectCtx* rctx, rgw::notify::EventType _type, rgw::sal::Bucket* _bucket, std::string& _user_id, std::string& _user_tenant, std::string& _req_id, optional_yield y) :
       Notification(_obj, _src_obj, _type), store(_store), res(_dpp, _store, rctx, _obj, _src_obj, _bucket, _user_id, _user_tenant, _req_id, y) {}