From 6e94076086f5ee78fc60aabd6ef17a55d04ca0e5 Mon Sep 17 00:00:00 2001 From: Yuval Lifshitz Date: Fri, 25 Nov 2022 16:15:27 +0200 Subject: [PATCH] rgw/notifications: add const to APIs when possible Signed-off-by: Yuval Lifshitz --- PendingReleaseNotes | 3 ++ src/rgw/driver/rados/rgw_notify.cc | 4 +- src/rgw/driver/rados/rgw_pubsub.cc | 56 +++++++++++++------------ src/rgw/driver/rados/rgw_pubsub.h | 55 ++++++++++++------------ src/rgw/driver/rados/rgw_rest_pubsub.cc | 16 +++---- src/rgw/driver/rados/rgw_sal_rados.cc | 4 +- src/rgw/rgw_admin.cc | 2 +- 7 files changed, 74 insertions(+), 66 deletions(-) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index e216861ba6fd..b6a18ff9a997 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -89,6 +89,9 @@ notifications needs to pull them (instead of the notifications be pushed to it), an external message bus (e.g. rabbitmq, Kafka) should be used for that purpose. +* RGW: The serialized format of notification and topics has changed, so that + new/updated topics will be unreadable by old RGWs. We recommend completing + the RGW upgrades before creating or modifying any notification topics. * RBD: Trailing newline in passphrase files (`` argument in `rbd encryption format` command and `--encryption-passphrase-file` option in other commands) is no longer stripped. diff --git a/src/rgw/driver/rados/rgw_notify.cc b/src/rgw/driver/rados/rgw_notify.cc index 0ff4a13fba6a..bfe1f9413600 100644 --- a/src/rgw/driver/rados/rgw_notify.cc +++ b/src/rgw/driver/rados/rgw_notify.cc @@ -777,8 +777,8 @@ static inline bool notification_match(reservation_t& res, reservation_t& res, const RGWObjTags* req_tags) { - RGWPubSub ps(res.store, res.user_tenant); - RGWPubSub::Bucket ps_bucket(&ps, res.bucket->get_key()); + const RGWPubSub ps(res.store, res.user_tenant); + const RGWPubSub::Bucket ps_bucket(ps, res.bucket->get_key()); rgw_pubsub_bucket_topics bucket_topics; auto rc = ps_bucket.get_topics(&bucket_topics); if (rc < 0) { diff --git a/src/rgw/driver/rados/rgw_pubsub.cc b/src/rgw/driver/rados/rgw_pubsub.cc index ab03e30f58f1..4ffee1769d92 100644 --- a/src/rgw/driver/rados/rgw_pubsub.cc +++ b/src/rgw/driver/rados/rgw_pubsub.cc @@ -15,7 +15,6 @@ #define dout_subsys ceph_subsys_rgw -using namespace std; void set_event_id(std::string& id, const std::string& hash, const utime_t& ts) { char buf[64]; const auto len = snprintf(buf, sizeof(buf), "%010ld.%06ld.%s", (long)ts.sec(), (long)ts.usec(), hash.c_str()); @@ -178,7 +177,7 @@ bool match(const rgw_s3_key_value_filter& filter, const KeyMultiValueMap& kv) { // object metadata/tags may include items not in the filter for (auto& filter : filter.kv) { auto result = kv.equal_range(filter.first); - if (std::any_of(result.first, result.second, [&filter](const pair& p) { return p.second == filter.second;})) + if (std::any_of(result.first, result.second, [&filter](const std::pair& p) { return p.second == filter.second;})) continue; else return false; @@ -194,7 +193,7 @@ bool match(const rgw::notify::EventTypeList& events, rgw::notify::EventType even return true; } -void do_decode_xml_obj(rgw::notify::EventTypeList& l, const string& name, XMLObj *obj) { +void do_decode_xml_obj(rgw::notify::EventTypeList& l, const std::string& name, XMLObj *obj) { l.clear(); XMLObjIter iter = obj->find(name); @@ -414,7 +413,7 @@ RGWPubSub::RGWPubSub(rgw::sal::RadosStore* _store, const std::string& _tenant) int RGWPubSub::remove(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, RGWObjVersionTracker *objv_tracker, - optional_yield y) + optional_yield y) const { int ret = rgw_delete_system_obj(dpp, store->svc()->sysobj, obj.pool, obj.oid, objv_tracker, y); if (ret < 0) { @@ -424,7 +423,7 @@ int RGWPubSub::remove(const DoutPrefixProvider *dpp, return 0; } -int RGWPubSub::read_topics(rgw_pubsub_topics *result, RGWObjVersionTracker *objv_tracker) +int RGWPubSub::read_topics(rgw_pubsub_topics *result, RGWObjVersionTracker *objv_tracker) const { int ret = read(meta_obj, result, objv_tracker); if (ret < 0) { @@ -435,7 +434,7 @@ int RGWPubSub::read_topics(rgw_pubsub_topics *result, RGWObjVersionTracker *objv } int RGWPubSub::write_topics(const DoutPrefixProvider *dpp, const rgw_pubsub_topics& topics, - RGWObjVersionTracker *objv_tracker, optional_yield y) + RGWObjVersionTracker *objv_tracker, optional_yield y) const { int ret = write(dpp, meta_obj, topics, objv_tracker, y); if (ret < 0 && ret != -ENOENT) { @@ -445,16 +444,16 @@ int RGWPubSub::write_topics(const DoutPrefixProvider *dpp, const rgw_pubsub_topi return 0; } -int RGWPubSub::get_topics(rgw_pubsub_topics *result) +int RGWPubSub::get_topics(rgw_pubsub_topics *result) const { return read_topics(result, nullptr); } -int RGWPubSub::Bucket::read_topics(rgw_pubsub_bucket_topics *result, RGWObjVersionTracker *objv_tracker) +int RGWPubSub::Bucket::read_topics(rgw_pubsub_bucket_topics *result, RGWObjVersionTracker *objv_tracker) const { - int ret = ps->read(bucket_meta_obj, result, objv_tracker); + int ret = ps.read(bucket_meta_obj, result, objv_tracker); if (ret < 0 && ret != -ENOENT) { - ldout(ps->store->ctx(), 1) << "ERROR: failed to read bucket topics info: ret=" << ret << dendl; + ldout(ps.store->ctx(), 1) << "ERROR: failed to read bucket topics info: ret=" << ret << dendl; return ret; } return 0; @@ -462,23 +461,23 @@ int RGWPubSub::Bucket::read_topics(rgw_pubsub_bucket_topics *result, RGWObjVersi int RGWPubSub::Bucket::write_topics(const DoutPrefixProvider *dpp, const rgw_pubsub_bucket_topics& topics, RGWObjVersionTracker *objv_tracker, - optional_yield y) + optional_yield y) const { - int ret = ps->write(dpp, bucket_meta_obj, topics, objv_tracker, y); + int ret = ps.write(dpp, bucket_meta_obj, topics, objv_tracker, y); if (ret < 0) { - ldout(ps->store->ctx(), 1) << "ERROR: failed to write bucket topics info: ret=" << ret << dendl; + ldout(ps.store->ctx(), 1) << "ERROR: failed to write bucket topics info: ret=" << ret << dendl; return ret; } return 0; } -int RGWPubSub::Bucket::get_topics(rgw_pubsub_bucket_topics *result) +int RGWPubSub::Bucket::get_topics(rgw_pubsub_bucket_topics *result) const { return read_topics(result, nullptr); } -int RGWPubSub::get_topic(const string& name, rgw_pubsub_topic *result) +int RGWPubSub::get_topic(const std::string& name, rgw_pubsub_topic *result) const { rgw_pubsub_topics topics; int ret = get_topics(&topics); @@ -497,14 +496,16 @@ int RGWPubSub::get_topic(const string& name, rgw_pubsub_topic *result) return 0; } -int RGWPubSub::Bucket::create_notification(const DoutPrefixProvider *dpp, const string& topic_name, const rgw::notify::EventTypeList& events, optional_yield y) { +int RGWPubSub::Bucket::create_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, + const rgw::notify::EventTypeList& events, optional_yield y) const { return create_notification(dpp, topic_name, events, std::nullopt, "", y); } -int RGWPubSub::Bucket::create_notification(const DoutPrefixProvider *dpp, const string& topic_name,const rgw::notify::EventTypeList& events, OptionalFilter s3_filter, const std::string& notif_name, optional_yield y) { +int RGWPubSub::Bucket::create_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, + const rgw::notify::EventTypeList& events, OptionalFilter s3_filter, const std::string& notif_name, optional_yield y) const { rgw_pubsub_topic topic_info; - int ret = ps->get_topic(topic_name, &topic_info); + int ret = ps.get_topic(topic_name, &topic_info); if (ret < 0) { ldpp_dout(dpp, 1) << "ERROR: failed to read topic '" << topic_name << "' info: ret=" << ret << dendl; return ret; @@ -542,11 +543,11 @@ int RGWPubSub::Bucket::create_notification(const DoutPrefixProvider *dpp, const return 0; } -int RGWPubSub::Bucket::remove_notification(const DoutPrefixProvider *dpp, const string& topic_name, optional_yield y) +int RGWPubSub::Bucket::remove_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, optional_yield y) const { rgw_pubsub_topic topic_info; - int ret = ps->get_topic(topic_name, &topic_info); + int ret = ps.get_topic(topic_name, &topic_info); if (ret < 0) { ldpp_dout(dpp, 1) << "ERROR: failed to read topic info: ret=" << ret << dendl; return ret; @@ -565,7 +566,7 @@ int RGWPubSub::Bucket::remove_notification(const DoutPrefixProvider *dpp, const if (bucket_topics.topics.empty()) { // no more topics - delete the notification object of the bucket - ret = ps->remove(dpp, bucket_meta_obj, &objv_tracker, y); + ret = ps.remove(dpp, bucket_meta_obj, &objv_tracker, y); if (ret < 0 && ret != -ENOENT) { ldpp_dout(dpp, 1) << "ERROR: failed to remove bucket topics: ret=" << ret << dendl; return ret; @@ -583,7 +584,7 @@ int RGWPubSub::Bucket::remove_notification(const DoutPrefixProvider *dpp, const return 0; } -int RGWPubSub::Bucket::remove_notifications(const DoutPrefixProvider *dpp, optional_yield y) +int RGWPubSub::Bucket::remove_notifications(const DoutPrefixProvider *dpp, optional_yield y) const { // get all topics on a bucket rgw_pubsub_bucket_topics bucket_topics; @@ -596,14 +597,14 @@ int RGWPubSub::Bucket::remove_notifications(const DoutPrefixProvider *dpp, optio // remove all auto-genrated topics for (const auto& topic : bucket_topics.topics) { const auto& topic_name = topic.first; - ret = ps->remove_topic(dpp, topic_name, y); + ret = ps.remove_topic(dpp, topic_name, y); if (ret < 0 && ret != -ENOENT) { ldpp_dout(dpp, 5) << "WARNING: failed to remove auto-generated topic '" << topic_name << "', ret=" << ret << dendl; } } // delete the notification object of the bucket - ret = ps->remove(dpp, bucket_meta_obj, nullptr, y); + ret = ps.remove(dpp, bucket_meta_obj, nullptr, y); if (ret < 0 && ret != -ENOENT) { ldpp_dout(dpp, 1) << "ERROR: failed to remove bucket topics: ret=" << ret << dendl; return ret; @@ -612,11 +613,12 @@ int RGWPubSub::Bucket::remove_notifications(const DoutPrefixProvider *dpp, optio return 0; } -int RGWPubSub::create_topic(const DoutPrefixProvider *dpp, const string& name, optional_yield y) { +int RGWPubSub::create_topic(const DoutPrefixProvider *dpp, const std::string& name, optional_yield y) const { return create_topic(dpp, name, rgw_pubsub_dest{}, "", "", y); } -int RGWPubSub::create_topic(const DoutPrefixProvider *dpp, const string& name, const rgw_pubsub_dest& dest, const std::string& arn, const std::string& opaque_data, optional_yield y) { +int RGWPubSub::create_topic(const DoutPrefixProvider *dpp, const std::string& name, const rgw_pubsub_dest& dest, + const std::string& arn, const std::string& opaque_data, optional_yield y) const { RGWObjVersionTracker objv_tracker; rgw_pubsub_topics topics; @@ -643,7 +645,7 @@ int RGWPubSub::create_topic(const DoutPrefixProvider *dpp, const string& name, c return 0; } -int RGWPubSub::remove_topic(const DoutPrefixProvider *dpp, const string& name, optional_yield y) +int RGWPubSub::remove_topic(const DoutPrefixProvider *dpp, const std::string& name, optional_yield y) const { RGWObjVersionTracker objv_tracker; rgw_pubsub_topics topics; diff --git a/src/rgw/driver/rados/rgw_pubsub.h b/src/rgw/driver/rados/rgw_pubsub.h index d3a9ebf6d3ae..6b5f029d7ef9 100644 --- a/src/rgw/driver/rados/rgw_pubsub.h +++ b/src/rgw/driver/rados/rgw_pubsub.h @@ -541,9 +541,9 @@ class RGWPubSub { friend class Bucket; - rgw::sal::RadosStore* store; + rgw::sal::RadosStore* const store; const std::string tenant; - RGWSI_SysObj* svc_sysobj; + RGWSI_SysObj* const svc_sysobj; rgw_raw_obj meta_obj; @@ -556,61 +556,63 @@ class RGWPubSub } template - int read(const rgw_raw_obj& obj, T* data, RGWObjVersionTracker* objv_tracker); + int read(const rgw_raw_obj& obj, T* data, RGWObjVersionTracker* objv_tracker) const; template int write(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, const T& info, - RGWObjVersionTracker* obj_tracker, optional_yield y); + RGWObjVersionTracker* obj_tracker, optional_yield y) const; int remove(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, RGWObjVersionTracker* objv_tracker, - optional_yield y); + optional_yield y) const; - int read_topics(rgw_pubsub_topics *result, RGWObjVersionTracker* objv_tracker); + int read_topics(rgw_pubsub_topics *result, RGWObjVersionTracker* objv_tracker) const; int write_topics(const DoutPrefixProvider *dpp, const rgw_pubsub_topics& topics, - RGWObjVersionTracker* objv_tracker, optional_yield y); + RGWObjVersionTracker* objv_tracker, optional_yield y) const; public: RGWPubSub(rgw::sal::RadosStore* _store, const std::string& tenant); class Bucket { friend class RGWPubSub; - RGWPubSub *ps; - rgw_bucket bucket; + const RGWPubSub& ps; + const rgw_bucket& bucket; rgw_raw_obj bucket_meta_obj; // read the list of topics associated with a bucket and populate into result // use version tacker to enforce atomicity between read/write // return 0 on success or if no topic was associated with the bucket, error code otherwise - int read_topics(rgw_pubsub_bucket_topics *result, RGWObjVersionTracker* objv_tracker); + int read_topics(rgw_pubsub_bucket_topics *result, RGWObjVersionTracker* objv_tracker) const; // set the list of topics associated with a bucket // use version tacker to enforce atomicity between read/write // return 0 on success, error code otherwise int write_topics(const DoutPrefixProvider *dpp, const rgw_pubsub_bucket_topics& topics, - RGWObjVersionTracker* objv_tracker, optional_yield y); + RGWObjVersionTracker* objv_tracker, optional_yield y) const; public: - Bucket(RGWPubSub *_ps, const rgw_bucket& _bucket) : ps(_ps), bucket(_bucket) { - ps->get_bucket_meta_obj(bucket, &bucket_meta_obj); + Bucket(const RGWPubSub& _ps, const rgw_bucket& _bucket) : ps(_ps), bucket(_bucket) { + ps.get_bucket_meta_obj(bucket, &bucket_meta_obj); } // read the list of topics associated with a bucket and populate into result // return 0 on success or if no topic was associated with the bucket, error code otherwise - int get_topics(rgw_pubsub_bucket_topics *result); + int get_topics(rgw_pubsub_bucket_topics *result) const; // adds a topic + filter (event list, and possibly name metadata or tags filters) to a bucket // assigning a notification name is optional (needed for S3 compatible notifications) // if the topic already exist on the bucket, the filter event list may be updated // for S3 compliant notifications the version with: s3_filter and notif_name should be used // return -ENOENT if the topic does not exists // return 0 on success, error code otherwise - int create_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, const rgw::notify::EventTypeList& events, optional_yield y); - int create_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, const rgw::notify::EventTypeList& events, OptionalFilter s3_filter, const std::string& notif_name, optional_yield y); + int create_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, + const rgw::notify::EventTypeList& events, optional_yield y) const; + int create_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, + const rgw::notify::EventTypeList& events, OptionalFilter s3_filter, const std::string& notif_name, optional_yield y) const; // remove a topic and filter from bucket // if the topic does not exists on the bucket it is a no-op (considered success) // return -ENOENT if the topic does not exists // return 0 on success, error code otherwise - int remove_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, optional_yield y); + int remove_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, optional_yield y) const; // remove all notifications (and autogenerated topics) associated with the bucket // return 0 on success or if no topic was associated with the bucket, error code otherwise - int remove_notifications(const DoutPrefixProvider *dpp, optional_yield y); + int remove_notifications(const DoutPrefixProvider *dpp, optional_yield y) const; }; void get_meta_obj(rgw_raw_obj *obj) const; @@ -618,28 +620,28 @@ public: // get all topics (per tenant, if used)) and populate them into "result" // return 0 on success or if no topics exist, error code otherwise - int get_topics(rgw_pubsub_topics *result); + int get_topics(rgw_pubsub_topics *result) const; // get a topic with by its name and populate it into "result" // return -ENOENT if the topic does not exists // return 0 on success, error code otherwise - int get_topic(const std::string& name, rgw_pubsub_topic *result); + int get_topic(const std::string& name, rgw_pubsub_topic *result) const; // create a topic with a name only // if the topic already exists it is a no-op (considered success) // return 0 on success, error code otherwise - int create_topic(const DoutPrefixProvider *dpp, const std::string& name, optional_yield y); + int create_topic(const DoutPrefixProvider *dpp, const std::string& name, optional_yield y) const; // create a topic with push destination information and ARN // if the topic already exists the destination and ARN values may be updated (considered succsess) // return 0 on success, error code otherwise - int create_topic(const DoutPrefixProvider *dpp, const std::string& name, const rgw_pubsub_dest& dest, const std::string& arn, const std::string& opaque_data, optional_yield y); + int create_topic(const DoutPrefixProvider *dpp, const std::string& name, const rgw_pubsub_dest& dest, + const std::string& arn, const std::string& opaque_data, optional_yield y) const; // remove a topic according to its name // if the topic does not exists it is a no-op (considered success) // return 0 on success, error code otherwise - int remove_topic(const DoutPrefixProvider *dpp, const std::string& name, optional_yield y); + int remove_topic(const DoutPrefixProvider *dpp, const std::string& name, optional_yield y) const; }; - template -int RGWPubSub::read(const rgw_raw_obj& obj, T* result, RGWObjVersionTracker* objv_tracker) +int RGWPubSub::read(const rgw_raw_obj& obj, T* result, RGWObjVersionTracker* objv_tracker) const { bufferlist bl; int ret = rgw_get_system_obj(svc_sysobj, @@ -663,7 +665,7 @@ int RGWPubSub::read(const rgw_raw_obj& obj, T* result, RGWObjVersionTracker* obj template int RGWPubSub::write(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, const T& info, - RGWObjVersionTracker* objv_tracker, optional_yield y) + RGWObjVersionTracker* objv_tracker, optional_yield y) const { bufferlist bl; encode(info, bl); @@ -671,3 +673,4 @@ int RGWPubSub::write(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, cons return rgw_put_system_obj(dpp, svc_sysobj, obj.pool, obj.oid, bl, false, objv_tracker, real_time(), y); } + diff --git a/src/rgw/driver/rados/rgw_rest_pubsub.cc b/src/rgw/driver/rados/rgw_rest_pubsub.cc index 92b402d379db..befcda4ae43f 100644 --- a/src/rgw/driver/rados/rgw_rest_pubsub.cc +++ b/src/rgw/driver/rados/rgw_rest_pubsub.cc @@ -627,7 +627,7 @@ auto find_unique_topic(const rgw_pubsub_bucket_topics& bucket_topics, const std: } } -int remove_notification_by_topic(const DoutPrefixProvider *dpp, const std::string& topic_name, RGWPubSub::Bucket& b, optional_yield y, RGWPubSub& ps) { +int remove_notification_by_topic(const DoutPrefixProvider *dpp, const std::string& topic_name, const RGWPubSub::Bucket& b, optional_yield y, const RGWPubSub& ps) { int op_ret = b.remove_notification(dpp, topic_name, y); if (op_ret < 0) { ldpp_dout(dpp, 1) << "failed to remove notification of topic '" << topic_name << "', ret=" << op_ret << dendl; @@ -639,7 +639,7 @@ int remove_notification_by_topic(const DoutPrefixProvider *dpp, const std::strin return op_ret; } -int delete_all_notifications(const DoutPrefixProvider *dpp, const rgw_pubsub_bucket_topics& bucket_topics, RGWPubSub::Bucket& b, optional_yield y, RGWPubSub& ps) { +int delete_all_notifications(const DoutPrefixProvider *dpp, const rgw_pubsub_bucket_topics& bucket_topics, const RGWPubSub::Bucket& b, optional_yield y, const RGWPubSub& ps) { // delete all notifications of on a bucket for (const auto& topic : bucket_topics.topics) { const auto op_ret = remove_notification_by_topic(dpp, topic.first, b, y, ps); @@ -734,8 +734,8 @@ void RGWPSCreateNotifOp::execute(optional_yield y) { return; } - RGWPubSub ps(static_cast(driver), s->owner.get_id().tenant); - RGWPubSub::Bucket b(&ps, bucket_info.bucket); + const RGWPubSub ps(static_cast(driver), s->owner.get_id().tenant); + const RGWPubSub::Bucket b(ps, bucket_info.bucket); if(configurations.list.empty()) { // get all topics on a bucket @@ -880,8 +880,8 @@ void RGWPSDeleteNotifOp::execute(optional_yield y) { return; } - RGWPubSub ps(static_cast(driver), s->owner.get_id().tenant); - RGWPubSub::Bucket b(&ps, bucket_info.bucket); + const RGWPubSub ps(static_cast(driver), s->owner.get_id().tenant); + const RGWPubSub::Bucket b(ps, bucket_info.bucket); // get all topics on a bucket rgw_pubsub_bucket_topics bucket_topics; @@ -979,8 +979,8 @@ private: }; void RGWPSListNotifsOp::execute(optional_yield y) { - RGWPubSub ps(static_cast(driver), s->owner.get_id().tenant); - RGWPubSub::Bucket b(&ps, bucket_info.bucket); + const RGWPubSub ps(static_cast(driver), s->owner.get_id().tenant); + const RGWPubSub::Bucket b(ps, bucket_info.bucket); // get all topics on a bucket rgw_pubsub_bucket_topics bucket_topics; diff --git a/src/rgw/driver/rados/rgw_sal_rados.cc b/src/rgw/driver/rados/rgw_sal_rados.cc index cd0e4e231b61..548090f23f64 100644 --- a/src/rgw/driver/rados/rgw_sal_rados.cc +++ b/src/rgw/driver/rados/rgw_sal_rados.cc @@ -470,8 +470,8 @@ int RadosBucket::remove_bucket(const DoutPrefixProvider* dpp, // if bucket has notification definitions associated with it // they should be removed (note that any pending notifications on the bucket are still going to be sent) - RGWPubSub ps(store, info.owner.tenant); - RGWPubSub::Bucket ps_bucket(&ps, info.bucket); + const RGWPubSub ps(store, info.owner.tenant); + const RGWPubSub::Bucket ps_bucket(ps, info.bucket); const auto ps_ret = ps_bucket.remove_notifications(dpp, y); if (ps_ret < 0 && ps_ret != -ENOENT) { ldpp_dout(dpp, -1) << "ERROR: unable to remove notifications from bucket. ret=" << ps_ret << dendl; diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 0ac61c279ba8..749ddefa238f 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -10465,7 +10465,7 @@ next: return -ret; } - RGWPubSub::Bucket b(&ps, bucket->get_key()); + const RGWPubSub::Bucket b(ps, bucket->get_key()); ret = b.get_topics(&result); if (ret < 0 && ret != -ENOENT) { cerr << "ERROR: could not get topics: " << cpp_strerror(-ret) << std::endl; -- 2.47.3