]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/logging: add size in MPU complete in standard mode
authorYuval Lifshitz <ylifshit@ibm.com>
Mon, 12 May 2025 18:05:30 +0000 (18:05 +0000)
committerYuval Lifshitz <ylifshit@ibm.com>
Mon, 23 Jun 2025 14:16:02 +0000 (14:16 +0000)
Fixes: https://tracker.ceph.com/issues/71288
Signed-off-by: Yuval Lifshitz <ylifshit@ibm.com>
(cherry picked from commit ccb6635922f260a779a9779d7def8335058e5431)

src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_process.cc

index 232aca1f4662d2b1a243c09cf00fbef058c3fccf..e6fc5b32586055bb47161418aa7fce3af3fa58b2 100644 (file)
@@ -7184,6 +7184,12 @@ void RGWCompleteMultipart::execute(optional_yield y)
     return;
   }
 
+  // size is logged in stadared mode
+  int ret = rgw::bucketlogging::log_record(driver, rgw::bucketlogging::LoggingType::Standard, s->object.get(), s, canonical_name(), "", ofs, this, y, true, false);
+  if (ret < 0) {
+    ldpp_dout(this, 5) << "WARNING: in Standard mode, complete MPU operation ignores bucket logging failure: " << ret << dendl;
+  }
+
   remove_objs.clear();
 
   // use cls_version_check() when deleting the meta object to detect part uploads that raced
@@ -7229,7 +7235,7 @@ void RGWCompleteMultipart::execute(optional_yield y)
   etag = s->object->get_attrs()[RGW_ATTR_ETAG].to_str();
 
   // send request to notification manager
-  int ret = res->publish_commit(this, ofs, upload_time, etag, s->object->get_instance());
+  ret = res->publish_commit(this, ofs, upload_time, etag, s->object->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 c8a5a4a960094c54b1c244d1c61bae322e703f08..ffddbe4c4e739202af8dd3a66071b7b28e614e57 100644 (file)
@@ -1972,6 +1972,7 @@ public:
   const char* name() const override { return "complete_multipart"; }
   RGWOpType get_type() override { return RGW_OP_COMPLETE_MULTIPART; }
   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
+  bool always_do_bucket_logging() const override { return false; }
 };
 
 class RGWAbortMultipart : public RGWOp {
index 704a6a7c2eea41ff1c8419a0f9cb4376f0cb871c..c0c34cebb66d22eb6335a6e3fc27f6a1af0d9f3e 100644 (file)
@@ -467,15 +467,15 @@ done:
   }
 
   if (op && op->always_do_bucket_logging()) {
-    std::ignore = rgw::bucketlogging::log_record(driver, 
+    std::ignore = rgw::bucketlogging::log_record(driver,
         rgw::bucketlogging::LoggingType::Standard,
         s->object.get(),
-        s, 
-        op->canonical_name(), 
-        "", 
+        s,
+        op->canonical_name(),
+        "",
         (s->src_object ? s->src_object->get_size() : (s->object ? s->object->get_size() : 0)),
-        op, 
-        yield, 
+        op,
+        yield,
         true,
         false);
   }