]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/notifications: send mtime in complete multipart upload event
authoryuval Lifshitz <ylifshit@redhat.com>
Mon, 14 Nov 2022 15:58:30 +0000 (17:58 +0200)
committeryuval Lifshitz <ylifshit@redhat.com>
Mon, 14 Nov 2022 15:58:30 +0000 (17:58 +0200)
this is a regression from: 61120ff1470eb6a9c3abb86cf5c88ee83d018ca2

Fixes: https://tracker.ceph.com/issues/58020
Signed-off-by: yuval Lifshitz <ylifshit@redhat.com>
src/rgw/rgw_op.cc
src/test/rgw/bucket_notification/test_bn.py

index 90c40778f217e699a5ae72e12b2d72bf76437c15..5f87e4170b61a9abc916f92ab208ce0667a80334 100644 (file)
@@ -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
index cb09d4aa38b74549a22a7b26b6bd1f16298436ec..a80ad6582e4fa10d99f6243b29a23d2df2f5fb89 100644 (file)
@@ -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)