return -EIO;
}
}
+ // bucket attrs are required for notification and since its not loaded,
+ // reload the bucket
+ int r = bucket->load_bucket(dpp, null_yield);
+ if (r < 0) {
+ ldpp_dout(dpp, 1) << "ERROR: failed to load bucket attrs for bucket:"
+ << bucket->get_name() << " with error ret= " << r
+ << " . Not sending notification" << dendl;
+ return r;
+ }
rgw::notify::reservation_t notify_res(dpp, store, obj, nullptr, bucket,
user_id, bucket->get_tenant(), req_id,
null_yield);
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include "rgw_notify.h"
rgw_pubsub_bucket_topics bucket_topics;
if (all_zonegroups_support(site, zone_features::notification_v2) &&
res.store->stat_topics_v1(res.user_tenant, res.yield, res.dpp) == -ENOENT) {
- auto ret = 0;
- if (!res.s) {
- // for non S3-request caller (e.g., lifecycle, ObjectSync), bucket attrs
- // are not loaded, so force to reload the bucket, that reloads the attr.
- // for non S3-request caller, res.s is nullptr
- ret = res.bucket->load_bucket(dpp, res.yield);
- if (ret < 0) {
- ldpp_dout(dpp, 1)
- << "ERROR: failed to reload bucket: '" << res.bucket->get_name()
- << "' to get bucket notification attrs with error ret= " << ret
- << dendl;
- return ret;
- }
- }
- ret = get_bucket_notifications(dpp, res.bucket, bucket_topics);
+ auto ret = get_bucket_notifications(dpp, res.bucket, bucket_topics);
if (ret < 0) {
return ret;
}