]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/logging: fix/remove/add bucket logging op names
authorYuval Lifshitz <ylifshit@ibm.com>
Thu, 12 Jun 2025 12:21:07 +0000 (12:21 +0000)
committerThomas Serlin <tserlin@redhat.com>
Mon, 22 Sep 2025 19:18:18 +0000 (15:18 -0400)
Fixes: https://tracker.ceph.com/issues/71638
Resolves: rhbz#2372311

Signed-off-by: Yuval Lifshitz <ylifshit@ibm.com>
(cherry picked from commit 326eef3501ce834f7067dfcc44963e3ef4c571df)

src/rgw/rgw_op.h
src/rgw/rgw_rest_bucket_logging.cc

index 8a043286aaf16115f284142ca1f010edaf609fc4..d746ea66de2dc4a982bd13f098852a77c427af98 100644 (file)
@@ -485,7 +485,12 @@ public:
   virtual int send_response_data(bufferlist& bl, off_t ofs, off_t len) = 0;
 
   const char* name() const override { return "get_obj"; }
-  std::string canonical_name() const override { return fmt::format("REST.{}.OBJECT", s->info.method); }
+  std::string canonical_name() const override {
+    if (get_torrent) {
+      return fmt::format("REST.{}.TORRENT", s->info.method);
+    }
+    return fmt::format("REST.{}.OBJECT", s->info.method);
+  }
   RGWOpType get_type() override { return RGW_OP_GET_OBJ; }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
   virtual bool need_object_expiration() { return false; }
@@ -946,7 +951,6 @@ public:
   virtual bool should_get_stats() { return false; }
 
   const char* name() const override { return "get_self_usage"; }
-  std::string canonical_name() const override { return fmt::format("REST.{}.USER_USAGE", s->info.method); }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
 };
 
@@ -963,7 +967,6 @@ public:
 
   void send_response() override = 0;
   const char* name() const override { return "stat_account"; }
-  std::string canonical_name() const override { return fmt::format("REST.{}.ACCOUNT_STATUS", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_STAT_ACCOUNT; }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
 };
@@ -1017,6 +1020,7 @@ public:
 
   void send_response() override = 0;
   const char* name() const override { return "get_bucket_location"; }
+  std::string canonical_name() const override { return fmt::format("REST.{}.LOCATION", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_GET_BUCKET_LOCATION; }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
 };
@@ -1132,7 +1136,6 @@ public:
   virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "stat_bucket"; }
-  std::string canonical_name() const override { return fmt::format("REST.{}.BUCKET_STATUS", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_STAT_BUCKET; }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
 };
@@ -1443,7 +1446,6 @@ public:
                                    const std::set<std::string>& rmattr_names,
                                    std::map<int, std::string>& temp_url_keys);
   const char* name() const override { return "put_account_metadata"; }
-  std::string canonical_name() const override { return fmt::format("REST.{}.ACCOUNT_METADATA", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_PUT_METADATA_ACCOUNT; }
   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
 };
@@ -1475,7 +1477,6 @@ public:
   virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "put_bucket_metadata"; }
-  std::string canonical_name() const override { return fmt::format("REST.{}.BUCKET_METADATA", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_PUT_METADATA_BUCKET; }
   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
 };
@@ -1498,7 +1499,6 @@ public:
   virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "put_obj_metadata"; }
-  std::string canonical_name() const override { return fmt::format("REST.{}.OBJECT_METADATA", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_PUT_METADATA_OBJECT; }
   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
   virtual bool need_object_expiration() { return false; }
@@ -1519,7 +1519,7 @@ public:
 
   void send_response() override = 0;
   const char* name() const override { return "restore_obj"; }
-  std::string canonical_name() const override { return fmt::format("REST.{}.OBJECT", s->info.method); }
+  std::string canonical_name() const override { return fmt::format("REST.{}.RESTORE", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_RESTORE_OBJ; }
   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
 };
@@ -1742,6 +1742,7 @@ public:
   void execute(optional_yield y) override;
   void send_response() override = 0;
   const char* name() const override { return "get_obj_attrs"; }
+  std::string canonical_name() const override { return fmt::format("REST.{}.OBJECT_ATTRIBUTES", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_GET_OBJ_ATTRS; }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
 }; /* RGWGetObjAttrs */
@@ -2580,6 +2581,7 @@ public:
   virtual void send_response() override = 0;
   virtual int get_params(optional_yield y) = 0;
   const char* name() const override { return "put_bucket_object_lock"; }
+  std::string canonical_name() const override { return fmt::format("REST.{}.OBJECT_LOCK", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_PUT_BUCKET_OBJ_LOCK; }
   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
 };
@@ -2591,6 +2593,7 @@ public:
   void execute(optional_yield y) override;
   virtual void send_response() override = 0;
   const char* name() const override {return "get_bucket_object_lock"; }
+  std::string canonical_name() const override { return fmt::format("REST.{}.OBJECT_LOCK", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_GET_BUCKET_OBJ_LOCK; }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
 };
@@ -2671,7 +2674,6 @@ public:
 
   virtual int get_params(optional_yield y) = 0;
   const char* name() const override { return "config_bucket_meta_search"; }
-  std::string canonical_name() const override { return fmt::format("REST.{}.BUCKET_MDSEARCH", s->info.method); }
   virtual RGWOpType get_type() override { return RGW_OP_CONFIG_BUCKET_META_SEARCH; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
 };
@@ -2685,7 +2687,6 @@ public:
   void execute(optional_yield) override {}
 
   const char* name() const override { return "get_bucket_meta_search"; }
-  std::string canonical_name() const override { return fmt::format("REST.{}.BUCKET_MDSEARCH", s->info.method); }
   virtual RGWOpType get_type() override { return RGW_OP_GET_BUCKET_META_SEARCH; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
 };
@@ -2699,7 +2700,6 @@ public:
   void execute(optional_yield y) override;
 
   const char* name() const override { return "delete_bucket_meta_search"; }
-  std::string canonical_name() const override { return fmt::format("REST.{}.BUCKET_MDSEARCH", s->info.method); }
   virtual RGWOpType delete_type() { return RGW_OP_DEL_BUCKET_META_SEARCH; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
 };
index 09c1a2200524c2834dc059d555fa901ea78d799c..e8bb5e643ebf1c00c5bf9b51947bce11d0fa2c39 100644 (file)
@@ -124,6 +124,7 @@ public:
     rgw_flush_formatter_and_reset(s, s->formatter);
   }
   const char* name() const override { return "get_bucket_logging"; }
+  std::string canonical_name() const override { return fmt::format("REST.{}.LOGGING", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_GET_BUCKET_LOGGING; }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
 };
@@ -215,6 +216,7 @@ class RGWPutBucketLoggingOp : public RGWDefaultResponseOp {
   }
 
   const char* name() const override { return "put_bucket_logging"; }
+  std::string canonical_name() const override { return fmt::format("REST.{}.LOGGING", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_PUT_BUCKET_LOGGING; }
   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
 
@@ -373,6 +375,7 @@ class RGWPostBucketLoggingOp : public RGWDefaultResponseOp {
   }
 
   const char* name() const override { return "post_bucket_logging"; }
+  std::string canonical_name() const override { return fmt::format("REST.{}.LOGGING", s->info.method); }
   RGWOpType get_type() override { return RGW_OP_POST_BUCKET_LOGGING; }
   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }