]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_sync_module_pubsub.cc
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / rgw / rgw_sync_module_pubsub.cc
index cf1d9543ac139f487add36b60f1f33d22fdf2ed5..c4df0fd67f540e42505129a19d9d19d56096b0e9 100644 (file)
@@ -380,14 +380,6 @@ struct objstore_event {
   }
 };
 
-static void set_event_id(std::string& id, const std::string& hash, const utime_t& ts) {
-  char buf[64];
-  const auto len = snprintf(buf, sizeof(buf), "%010ld.%06ld.%s", (long)ts.sec(), (long)ts.usec(), hash.c_str());
-  if (len > 0) {
-    id.assign(buf, len);
-  }
-}
-
 static void make_event_ref(CephContext *cct, const rgw_bucket& bucket,
                        const rgw_obj_key& key,
                        const ceph::real_time& mtime,
@@ -419,22 +411,18 @@ static void make_s3_record_ref(CephContext *cct, const rgw_bucket& bucket,
   *record = std::make_shared<rgw_pubsub_s3_record>();
 
   EventRef<rgw_pubsub_s3_record>& r = *record;
-  r->eventVersion = "2.1";
-  r->eventSource = "aws:s3";
   r->eventTime = mtime;
   r->eventName = rgw::notify::to_string(event_type);
-  r->userIdentity = "";         // user that triggered the change: not supported in sync module
-  r->sourceIPAddress = "";      // IP address of client that triggered the change: not supported in sync module
-  r->x_amz_request_id = "";     // request ID of the original change: not supported in sync module
-  r->x_amz_id_2 = "";           // RGW on which the change was made: not supported in sync module
-  r->s3SchemaVersion = "1.0";
+  // userIdentity: not supported in sync module
+  // x_amz_request_id: not supported in sync module
+  // x_amz_id_2: not supported in sync module
   // configurationId is filled from subscription configuration
   r->bucket_name = bucket.name;
   r->bucket_ownerIdentity = owner.to_str();
   r->bucket_arn = to_string(rgw::ARN(bucket));
   r->bucket_id = bucket.bucket_id; // rgw extension
   r->object_key = key.name;
-  r->object_size = 0;           // not supported in sync module
+  // object_size not supported in sync module
   objstore_event oevent(bucket, key, mtime, attrs);
   r->object_etag = oevent.get_hash();
   r->object_versionId = key.instance;
@@ -444,8 +432,6 @@ static void make_s3_record_ref(CephContext *cct, const rgw_bucket& bucket,
   boost::algorithm::hex((const char*)&ts, (const char*)&ts + sizeof(utime_t), 
           std::back_inserter(r->object_sequencer));
  
-  // event ID is rgw extension (not in the S3 spec), used for acking the event
-  // same format is used in both S3 compliant and Ceph specific events
   set_event_id(r->id, r->object_etag, ts);
 }
 
@@ -477,7 +463,7 @@ public:
   PSEvent(const EventRef<EventType>& _event) : event(_event) {}
 
   void format(bufferlist *bl) const {
-    bl->append(json_str(EventType::json_type_single, *event));
+    bl->append(json_str("", *event));
   }
 
   void encode_event(bufferlist& bl) const {