From 41b402fe9428e56bbbf7a9055837c78ae90d607a Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 9 Dec 2022 13:46:14 -0500 Subject: [PATCH] rgw/sal: get_notification() takes optional_yield Fixes: https://tracker.ceph.com/issues/58231 Signed-off-by: Casey Bodley --- src/rgw/driver/rados/rgw_sal_rados.cc | 4 ++-- src/rgw/driver/rados/rgw_sal_rados.h | 6 +++--- src/rgw/rgw_op.cc | 12 ++++++------ src/rgw/rgw_sal.h | 2 +- src/rgw/rgw_sal_daos.h | 2 +- src/rgw/rgw_sal_dbstore.cc | 3 ++- src/rgw/rgw_sal_dbstore.h | 2 +- src/rgw/rgw_sal_filter.cc | 4 ++-- src/rgw/rgw_sal_filter.h | 2 +- src/rgw/rgw_sal_motr.h | 2 +- 10 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/rgw/driver/rados/rgw_sal_rados.cc b/src/rgw/driver/rados/rgw_sal_rados.cc index 577569dd5d5..4bfd80e9ff8 100644 --- a/src/rgw/driver/rados/rgw_sal_rados.cc +++ b/src/rgw/driver/rados/rgw_sal_rados.cc @@ -1273,9 +1273,9 @@ std::unique_ptr RadosStore::get_completions(void) } std::unique_ptr 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(s, this, obj, src_obj, s, event_type, object_name); + return std::make_unique(s, this, obj, src_obj, s, event_type, y, object_name); } std::unique_ptr 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) diff --git a/src/rgw/driver/rados/rgw_sal_rados.h b/src/rgw/driver/rados/rgw_sal_rados.h index 58b662321fa..37713d28f37 100644 --- a/src/rgw/driver/rados/rgw_sal_rados.h +++ b/src/rgw/driver/rados/rgw_sal_rados.h @@ -164,7 +164,7 @@ class RadosStore : public StoreDriver { virtual int cluster_stat(RGWClusterStat& stats) override; virtual std::unique_ptr get_lifecycle(void) override; virtual std::unique_ptr get_completions(void) override; - virtual std::unique_ptr 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 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 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) {} diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 29552560b27..ecb25f6d208 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -3969,7 +3969,7 @@ void RGWPutObj::execute(optional_yield y) std::unique_ptr 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 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 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 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 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 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); diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 1a24045adf1..bae96e2cddc 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -330,7 +330,7 @@ class Driver { * management/tracking software */ /** RGWOp variant */ virtual std::unique_ptr 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 get_notification( const DoutPrefixProvider* dpp, rgw::sal::Object* obj, rgw::sal::Object* src_obj, diff --git a/src/rgw/rgw_sal_daos.h b/src/rgw/rgw_sal_daos.h index f172a8abe3b..e94d584374a 100644 --- a/src/rgw/rgw_sal_daos.h +++ b/src/rgw/rgw_sal_daos.h @@ -935,7 +935,7 @@ class DaosStore : public StoreDriver { virtual std::unique_ptr get_completions(void) override; virtual std::unique_ptr 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 get_notification( const DoutPrefixProvider* dpp, rgw::sal::Object* obj, diff --git a/src/rgw/rgw_sal_dbstore.cc b/src/rgw/rgw_sal_dbstore.cc index a99a412d4dd..c16096b761a 100644 --- a/src/rgw/rgw_sal_dbstore.cc +++ b/src/rgw/rgw_sal_dbstore.cc @@ -1826,7 +1826,8 @@ namespace rgw::sal { std::unique_ptr 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(obj, src_obj, event_type); } diff --git a/src/rgw/rgw_sal_dbstore.h b/src/rgw/rgw_sal_dbstore.h index a7f496191c7..24ba6bb964d 100644 --- a/src/rgw/rgw_sal_dbstore.h +++ b/src/rgw/rgw_sal_dbstore.h @@ -814,7 +814,7 @@ public: virtual std::unique_ptr 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 get_notification( const DoutPrefixProvider* dpp, rgw::sal::Object* obj, diff --git a/src/rgw/rgw_sal_filter.cc b/src/rgw/rgw_sal_filter.cc index ba5ed023227..923b89dd23e 100644 --- a/src/rgw/rgw_sal_filter.cc +++ b/src/rgw/rgw_sal_filter.cc @@ -275,12 +275,12 @@ std::unique_ptr FilterDriver::get_completions(void) std::unique_ptr 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 n = next->get_notification(nextObject(obj), nextObject(src_obj), - s, event_type, + s, event_type, y, object_name); return std::make_unique(std::move(n)); } diff --git a/src/rgw/rgw_sal_filter.h b/src/rgw/rgw_sal_filter.h index 88bd81ee10d..df44ea70157 100644 --- a/src/rgw/rgw_sal_filter.h +++ b/src/rgw/rgw_sal_filter.h @@ -202,7 +202,7 @@ public: virtual std::unique_ptr 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 get_notification( const DoutPrefixProvider* dpp, rgw::sal::Object* obj, rgw::sal::Object* src_obj, diff --git a/src/rgw/rgw_sal_motr.h b/src/rgw/rgw_sal_motr.h index ad9328b9519..aab47acaa5b 100644 --- a/src/rgw/rgw_sal_motr.h +++ b/src/rgw/rgw_sal_motr.h @@ -953,7 +953,7 @@ class MotrStore : public StoreDriver { virtual std::unique_ptr get_lifecycle(void) override; virtual std::unique_ptr get_completions(void) override; virtual std::unique_ptr 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 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; -- 2.39.5