]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/notification: Make the Replication events to be aws compatible.
authorkchheda3 <kchheda3@bloomberg.net>
Tue, 27 Feb 2024 19:24:43 +0000 (14:24 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 10 Apr 2024 13:18:07 +0000 (09:18 -0400)
Signed-off-by: kchheda3 <kchheda3@bloomberg.net>
(cherry picked from commit 3ea110bb89a7f666de25f8a128fa8bbb231e304f)

doc/radosgw/s3-notification-compatibility.rst
src/rgw/driver/rados/rgw_cr_rados.cc
src/rgw/rgw_notify_event_type.cc
src/rgw/rgw_notify_event_type.h

index b29989977b2311983593457529caf2e8bff65144..31b218456bd8e744d3c0a0ca394f388f4ed2dec1 100644 (file)
@@ -113,6 +113,14 @@ Event Types
 +--------------------------------------------------------+-----------------------------------------+
 | ``s3:ObjectSynced:DeletionMarkerCreated``              | Defined, Ceph extension (not generated) |
 +--------------------------------------------------------+-----------------------------------------+
+| ``s3:Replication:*``                                   | Supported                               |
++--------------------------------------------------------+-----------------------------------------+
+| ``s3:Replication:Create``                              | Supported                               |
++--------------------------------------------------------+-----------------------------------------+
+| ``s3:Replication:Delete``                              | Defined, Supported (not generated)      |
++--------------------------------------------------------+-----------------------------------------+
+| ``s3:Replication:DeletionMarkerCreated``               | Defined, Supported (not generated)      |
++--------------------------------------------------------+-----------------------------------------+
 | ``s3:ObjectRestore:Post``                              | Not applicable                          |
 +--------------------------------------------------------+-----------------------------------------+
 | ``s3:ObjectRestore:Complete``                          | Not applicable                          |
index a6d4719e718646a4179619b7207022e0cb27a46c..7e4164ff7dde50fb7af60685b320aead111b9f66 100644 (file)
@@ -806,15 +806,18 @@ int RGWAsyncFetchRemoteObj::_send_request(const DoutPrefixProvider *dpp)
         std::string tenant(dest_bucket.get_tenant());
 
         std::unique_ptr<rgw::sal::Notification> notify =
-            store->get_notification(
-                dpp, &dest_obj, nullptr, {rgw::notify::ObjectSyncedCreate},
-                &dest_bucket, user_id, tenant, req_id, null_yield);
+            store->get_notification(dpp, &dest_obj, nullptr,
+                                    {rgw::notify::ObjectSyncedCreate,
+                                     rgw::notify::ReplicationCreate},
+                                    &dest_bucket, user_id, tenant, req_id,
+                                    null_yield);
 
         auto notify_res =
             static_cast<rgw::sal::RadosNotification*>(notify.get())
                 ->get_reservation();
         int ret = rgw::notify::publish_reserve(
-            dpp, *store->svc()->site, {rgw::notify::ObjectSyncedCreate},
+            dpp, *store->svc()->site,
+            {rgw::notify::ObjectSyncedCreate, rgw::notify::ReplicationCreate},
             notify_res, &obj_tags);
         if (ret < 0) {
           ldpp_dout(dpp, 1)
index d36e10c9c2d3b98f58faca76b1c4abd9170e7b20..9baa5df798bdabd5946c00ce6181cec0db1a92bb 100644 (file)
@@ -58,6 +58,14 @@ namespace rgw::notify {
       return "s3:LifecycleExpiration:DeleteMarkerCreated";
     case LifecycleTransition:
       return "s3:LifecycleTransition";
+    case Replication:
+      return "s3:Replication:*";
+    case ReplicationCreate:
+      return "s3:Replication:Create";
+    case ReplicationDelete:
+      return "s3:Replication:Delete";
+    case ReplicationDeletionMarkerCreated:
+      return "s3:Replication:DeletionMarkerCreated";
     case UnknownEvent:
         return "s3:UnknownEvent";
     }
@@ -119,6 +127,14 @@ namespace rgw::notify {
       return LifecycleExpirationDeleteMarkerCreated;
     if (s == "s3:LifecycleTransition")
       return LifecycleTransition;
+    if (s == "s3:Replication:*")
+      return Replication;
+    if (s == "s3:Replication:Create")
+      return ReplicationCreate;
+    if (s == "s3:Replication:Delete")
+      return ReplicationDelete;
+    if (s == "s3:Replication:DeletionMarkerCreated")
+      return ReplicationDeletionMarkerCreated;
     return UnknownEvent;
   }
 
index d7f70682d162749382f35e9eb17fb96d42bc2a15..34a73d229979960ae82ad440b8da3953136513f5 100644 (file)
@@ -33,7 +33,11 @@ namespace rgw::notify {
     LifecycleExpirationDelete              = 0x100000,
     LifecycleExpirationDeleteMarkerCreated = 0x200000,
     LifecycleTransition                    = 0xF000000,
-    UnknownEvent                           = 0x10000000
+    Replication                            = 0xF0000000,
+    ReplicationCreate                      = 0x10000000,
+    ReplicationDelete                      = 0x20000000,
+    ReplicationDeletionMarkerCreated       = 0x40000000,
+    UnknownEvent                           = 0x100000000
 };
 
   using EventTypeList = std::vector<EventType>;