]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/notifications: send mtime in complete multipart upload event 50962/head
authoryuval Lifshitz <ylifshit@redhat.com>
Mon, 14 Nov 2022 15:58:30 +0000 (17:58 +0200)
committerYuval Lifshitz <ylifshit@redhat.com>
Sun, 9 Apr 2023 13:33:22 +0000 (13:33 +0000)
this is a regression from: 61120ff1470eb6a9c3abb86cf5c88ee83d018ca2

Fixes: https://tracker.ceph.com/issues/58020
Signed-off-by: yuval Lifshitz <ylifshit@redhat.com>
(cherry picked from commit 56a929cbbe01e5dd521fa096bc111da2cd351801)

src/rgw/rgw_op.cc
src/test/rgw/bucket_notification/test_bn.py

index 09cfa355759c2dc991605d46cd7ed94722512d4a..bb224911ebfbf32d58359a26697d7728b0413d88 100644 (file)
@@ -6409,7 +6409,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 0f74ae991ad99e0fda2f8d4e0f6d25adf31c3cdd..21933c07c148c172dd22a07f54b4fed9b9f73bf8 100644 (file)
@@ -2138,7 +2138,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)