]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/notifications: Changing the Multipart Upload notification behavior 47175/head
authorKalpesh Pandya <kapandya@redhat.com>
Wed, 14 Jul 2021 08:38:42 +0000 (14:08 +0530)
committeryuval Lifshitz <ylifshit@redhat.com>
Tue, 19 Jul 2022 17:10:41 +0000 (20:10 +0300)
Changing the notification behavior in case of Multipart Upload, updating
the related test cases and adding the documentation changes for the same.

Signed-off-by: Kalpesh Pandya <kapandya@redhat.com>
(cherry picked from commit 3be2b4bcc5686a5ff5e348dba2deda444d336bb8)

Conflicts:
src/rgw/rgw_op.cc
src/test/rgw/bucket_notification/test_bn.py
        (pacific does not have test_bn.py)

PendingReleaseNotes
doc/radosgw/s3-notification-compatibility.rst
src/rgw/rgw_op.cc

index 1ff5d73ba64d4e20905de219321e3e41d6d481ea..ca705eefc8e3d7b7cbf2e1b3f2412d4fdc6c1d51 100644 (file)
 >=16.2.8
 --------
 
+* RGW: The behavior for Multipart Upload was modified so that only 
+  CompleteMultipartUpload notification is sent at the end of the multipart upload. 
+  The POST notification at the beginning of the upload, and PUT notifications that 
+  were sent on each part are not sent anymore.
+
 * MON/MGR: Pools can now be created with `--bulk` flag. Any pools created with `bulk`
   will use a profile of the `pg_autoscaler` that provides more performance from the start.
   However, any pools created without the `--bulk` flag will remain using it's old behavior
index 008c33a59bd8a64490734ac6df26152d46a802e0..09054bed39245a87d20ac5eed064d1a4a05eb8ed 100644 (file)
@@ -109,6 +109,10 @@ Event Types
 
    The ``s3:ObjectRemoved:DeleteMarkerCreated`` event presents information on the latest version of the object
 
+.. note::
+
+   In case of multipart upload, an ``ObjectCreated:CompleteMultipartUpload`` notification will be sent at the end of the process.
+
 Topic Configuration
 -------------------
 In the case of bucket notifications, the topics management API will be derived from `AWS Simple Notification Service API`_. 
index 1b844fa5ec83c20415f2d3bfd0caeccfa2d32f6c..6ebc8dc89036bfb1b70e9b6f47a63c2a83d969ab 100644 (file)
@@ -3826,9 +3826,11 @@ void RGWPutObj::execute(optional_yield y)
   // make reservation for notification if needed
   rgw::notify::reservation_t res(this, store, s, s->object.get());
   const auto event_type = rgw::notify::ObjectCreatedPut;
-  op_ret = rgw::notify::publish_reserve(this, event_type, res, obj_tags.get());
-  if (op_ret < 0) {
-    return;
+  if(!multipart) {
+    op_ret = rgw::notify::publish_reserve(this, event_type, res, obj_tags.get());
+    if (op_ret < 0) {
+      return;
+    }
   }
 
   // create the object processor
@@ -6024,14 +6026,6 @@ void RGWInitMultipart::execute(optional_yield y)
     return;
   }
 
-  // make reservation for notification if needed
-  rgw::notify::reservation_t res(this, store, s, s->object.get());
-  const auto event_type = rgw::notify::ObjectCreatedPost;
-  op_ret = rgw::notify::publish_reserve(this, event_type, res, nullptr);
-  if (op_ret < 0) {
-    return;
-  }
-
   do {
     char buf[33];
     std::unique_ptr<rgw::sal::RGWObject> obj;
@@ -6068,13 +6062,6 @@ void RGWInitMultipart::execute(optional_yield y)
 
     op_ret = obj_op->write_meta(this, bl.length(), 0, s->yield);
   } while (op_ret == -EEXIST);
-
-  // send request to notification manager
-  const auto ret = rgw::notify::publish_commit(s->object.get(), s->obj_size, ceph::real_clock::now(), attrs[RGW_ATTR_ETAG].to_str(), event_type, res, this);
-  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
-  }
 }
 
 int RGWCompleteMultipart::verify_permission(optional_yield y)