From: Jane Zhu Date: Mon, 1 May 2023 02:20:16 +0000 (-0400) Subject: rgw/notification: read object size from the rados obj when populate sync notification X-Git-Tag: v18.2.1~253^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8685671b89acea711bf35cf7d091210220583e61;p=ceph-ci.git rgw/notification: read object size from the rados obj when populate sync notification Signed-off-by: Juan Zhu (cherry picked from commit 31a390bb6baddb1ca26ccf96dc42a4628ae8a0e7) --- diff --git a/src/rgw/driver/rados/rgw_cr_rados.cc b/src/rgw/driver/rados/rgw_cr_rados.cc index 25d1e9a9dca..d8e0ecba63e 100644 --- a/src/rgw/driver/rados/rgw_cr_rados.cc +++ b/src/rgw/driver/rados/rgw_cr_rados.cc @@ -814,7 +814,7 @@ int RGWAsyncFetchRemoteObj::_send_request(const DoutPrefixProvider *dpp) ldpp_dout(dpp, 1) << "ERROR: reserving notification failed, with error: " << ret << dendl; // no need to return, the sync already happened } else { - ret = rgw::notify::publish_commit(&dest_obj, dest_obj.get_obj_size(), ceph::real_clock::now(), etag, dest_obj.get_instance(), rgw::notify::ObjectSyncedCreate, notify_res, dpp); + ret = rgw::notify::publish_commit(&dest_obj, *bytes_transferred, ceph::real_clock::now(), etag, dest_obj.get_instance(), rgw::notify::ObjectSyncedCreate, notify_res, dpp); if (ret < 0) { ldpp_dout(dpp, 1) << "ERROR: publishing notification failed, with error: " << ret << dendl; } diff --git a/src/rgw/driver/rados/rgw_notify.cc b/src/rgw/driver/rados/rgw_notify.cc index 0821e69a939..1a1f9dd59f2 100644 --- a/src/rgw/driver/rados/rgw_notify.cc +++ b/src/rgw/driver/rados/rgw_notify.cc @@ -690,7 +690,8 @@ static inline void populate_event(reservation_t& res, event.x_amz_id_2 = res.store->getRados()->host_id; // RGW on which the change was made // configurationId is filled from notification configuration event.bucket_name = res.bucket->get_name(); - event.bucket_ownerIdentity = res.bucket->get_owner() ? res.bucket->get_owner()->get_id().id : ""; + event.bucket_ownerIdentity = res.bucket->get_owner() ? + res.bucket->get_owner()->get_id().id : res.bucket->get_info().owner.id; const auto region = res.store->get_zone()->get_zonegroup().get_api_name(); rgw::ARN bucket_arn(res.bucket->get_key()); bucket_arn.region = region;