From: Daniel Gryniewicz Date: Mon, 1 Aug 2022 16:11:36 +0000 (-0400) Subject: RGW - Zipper - LC - Allow notifications on all stores X-Git-Tag: v18.0.0~186^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5a6fb22707fe0391b0cb11f15604e567ad3defe9;p=ceph.git RGW - Zipper - LC - Allow notifications on all stores The notification API exsits in all stores, so make the useage unconditional. Signed-off-by: Daniel Gryniewicz --- diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 5768257e4c9f..ec2bba845c64 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -561,38 +561,30 @@ static int remove_expired_obj( del_op->params.unmod_since = meta.mtime; del_op->params.marker_version_id = version_id; - rgw::sal::RadosStore *rados = dynamic_cast(oc.store); - if (rados) { - // notification supported only for RADOS store for now - notify - = store->get_notification(dpp, obj.get(), nullptr, event_type, - bucket.get(), lc_id, - const_cast(oc.bucket->get_tenant()), - lc_req_id, null_yield); - - /* can eliminate cast when reservation is lifted into Notification */ - auto notify_res = static_cast(notify.get())->get_reservation(); - - ret = rgw::notify::publish_reserve(dpp, event_type, notify_res, nullptr); - if ( ret < 0) { - ldpp_dout(dpp, 1) - << "ERROR: notify reservation failed, deferring delete of object k=" - << o.key - << dendl; - return ret; - } + // notification supported only for RADOS store for now + notify = store->get_notification(dpp, obj.get(), nullptr, event_type, + bucket.get(), lc_id, + const_cast(oc.bucket->get_tenant()), + lc_req_id, null_yield); + + ret = notify->publish_reserve(dpp, nullptr); + if ( ret < 0) { + ldpp_dout(dpp, 1) + << "ERROR: notify reservation failed, deferring delete of object k=" + << o.key + << dendl; + return ret; } ret = del_op->delete_obj(dpp, null_yield); if (ret < 0) { ldpp_dout(dpp, 1) << "ERROR: publishing notification failed, with error: " << ret << dendl; - } else if (rados) { + } else { // send request to notification manager - auto notify_res = static_cast(notify.get())->get_reservation(); - (void) rgw::notify::publish_commit( - obj.get(), obj->get_obj_size(), ceph::real_clock::now(), - obj->get_attrs()[RGW_ATTR_ETAG].to_str(), version_id, event_type, - notify_res, dpp); + (void) notify->publish_commit(dpp, obj->get_obj_size(), + ceph::real_clock::now(), + obj->get_attrs()[RGW_ATTR_ETAG].to_str(), + version_id); } return ret;