From 56a929cbbe01e5dd521fa096bc111da2cd351801 Mon Sep 17 00:00:00 2001 From: yuval Lifshitz Date: Mon, 14 Nov 2022 17:58:30 +0200 Subject: [PATCH] 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 --- src/rgw/rgw_op.cc | 2 +- src/test/rgw/bucket_notification/test_bn.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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) -- 2.39.5