mirror of
https://github.com/ceph/ceph
synced 2025-03-10 02:09:21 +00:00
Merge pull request #36238 from yuvalif/fix_zippet_notif_merge
rgw/notification: fix merge issues from zipper6
This commit is contained in:
commit
4f6745cb24
@ -46,11 +46,11 @@ void populate_record_from_request(const req_state *s,
|
||||
// opaque data will be filled from topic configuration
|
||||
}
|
||||
|
||||
bool match(const rgw_pubsub_topic_filter& filter, const req_state* s, EventType event) {
|
||||
bool match(const rgw_pubsub_topic_filter& filter, const req_state* s, const rgw::sal::RGWObject* obj, EventType event) {
|
||||
if (!::match(filter.events, event)) {
|
||||
return false;
|
||||
}
|
||||
if (!::match(filter.s3_filter.key_filter, s->object->get_name())) {
|
||||
if (!::match(filter.s3_filter.key_filter, obj->get_name())) {
|
||||
return false;
|
||||
}
|
||||
if (!::match(filter.s3_filter.metadata_filter, s->info.x_meta_map)) {
|
||||
@ -83,7 +83,7 @@ int publish(const req_state* s,
|
||||
for (const auto& bucket_topic : bucket_topics.topics) {
|
||||
const rgw_pubsub_topic_filter& topic_filter = bucket_topic.second;
|
||||
const rgw_pubsub_topic& topic_cfg = topic_filter.topic;
|
||||
if (!match(topic_filter, s, event_type)) {
|
||||
if (!match(topic_filter, s, obj, event_type)) {
|
||||
// topic does not apply to req_state
|
||||
continue;
|
||||
}
|
||||
|
@ -4871,19 +4871,19 @@ void RGWDeleteObj::execute()
|
||||
ldpp_dout(this, 5) << "WARNING: failed to populate delete request with object tags: " << err.what() << dendl;
|
||||
}
|
||||
populate_metadata_in_request(s, attrs.attrs);
|
||||
} else {
|
||||
op_ret = -EINVAL;
|
||||
}
|
||||
|
||||
s->object->set_obj_size(s->obj_size);
|
||||
const auto ret = rgw::notify::publish(s, s->object.get(), ceph::real_clock::now(), attrs.attrs[RGW_ATTR_ETAG].to_str(),
|
||||
const auto obj_state = obj_ctx->get_state(s->object->get_obj());
|
||||
s->object->set_obj_size(obj_state->size);
|
||||
const auto ret = rgw::notify::publish(s, s->object.get(), ceph::real_clock::now(), attrs.attrs[RGW_ATTR_ETAG].to_str(),
|
||||
delete_marker && s->object->get_instance().empty() ? rgw::notify::ObjectRemovedDeleteMarkerCreated : rgw::notify::ObjectRemovedDelete,
|
||||
store);
|
||||
if (ret < 0) {
|
||||
ldpp_dout(this, 5) << "WARNING: publishing notification failed, with error: " << ret << dendl;
|
||||
// TODO: we should have conf to make send a blocking coroutine and reply with error in case sending failed
|
||||
// this should be global conf (probably returnign a different handler)
|
||||
// so we don't need to read the configured values before we perform it
|
||||
if (ret < 0) {
|
||||
ldpp_dout(this, 5) << "WARNING: publishing notification failed, with error: " << ret << dendl;
|
||||
// TODO: we should have conf to make send a blocking coroutine and reply with error in case sending failed
|
||||
// this should be global conf (probably returnign a different handler)
|
||||
// so we don't need to read the configured values before we perform it
|
||||
}
|
||||
} else {
|
||||
op_ret = -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -6557,7 +6557,7 @@ void RGWDeleteMultiObj::execute()
|
||||
obj.set_obj_size(obj_state->size);
|
||||
|
||||
const auto ret = rgw::notify::publish(s, &obj, ceph::real_clock::now(), etag,
|
||||
del_op.result.delete_marker && s->object->get_instance().empty() ? rgw::notify::ObjectRemovedDeleteMarkerCreated : rgw::notify::ObjectRemovedDelete,
|
||||
del_op.result.delete_marker && obj.get_instance().empty() ? rgw::notify::ObjectRemovedDeleteMarkerCreated : rgw::notify::ObjectRemovedDelete,
|
||||
store);
|
||||
if (ret < 0) {
|
||||
ldpp_dout(this, 5) << "WARNING: publishing notification failed, with error: " << ret << dendl;
|
||||
|
Loading…
Reference in New Issue
Block a user