From: yuval Lifshitz Date: Mon, 14 Nov 2022 15:58:30 +0000 (+0200) Subject: rgw/notifications: send mtime in complete multipart upload event X-Git-Tag: v18.1.0~840^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=56a929cbbe01e5dd521fa096bc111da2cd351801;p=ceph-ci.git rgw/notifications: send mtime in complete multipart upload event this is a regression from: 61120ff1470eb6a9c3abb86cf5c88ee83d018ca2 Fixes: https://tracker.ceph.com/issues/58020 Signed-off-by: yuval Lifshitz --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 90c40778f21..5f87e4170b6 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -6462,7 +6462,7 @@ void RGWCompleteMultipart::execute(optional_yield y) } // send request to notification manager - int ret = res->publish_commit(this, ofs, target_obj->get_mtime(), etag, target_obj->get_instance()); + int ret = res->publish_commit(this, ofs, upload->get_mtime(), etag, target_obj->get_instance()); if (ret < 0) { ldpp_dout(this, 1) << "ERROR: publishing notification failed, with error: " << ret << dendl; // too late to rollback operation, hence op_ret is not set here diff --git a/src/test/rgw/bucket_notification/test_bn.py b/src/test/rgw/bucket_notification/test_bn.py index cb09d4aa38b..a80ad6582e4 100644 --- a/src/test/rgw/bucket_notification/test_bn.py +++ b/src/test/rgw/bucket_notification/test_bn.py @@ -2140,7 +2140,8 @@ def test_ps_s3_multipart_on_master(): assert_equal(len(events), 1) assert_equal(events[0]['Records'][0]['eventName'], 'ObjectCreated:CompleteMultipartUpload') assert_equal(events[0]['Records'][0]['s3']['configurationId'], notification_name+'_3') - print(events[0]['Records'][0]['s3']['object']['size']) + assert_equal(events[0]['Records'][0]['s3']['object']['size'], object_size) + assert events[0]['Records'][0]['eventTime'] != '0.000000', 'invalid eventTime' # cleanup stop_amqp_receiver(receiver1, task1)