]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/osd: Enable an application for pools created by ceph_test_rados_io_sequence
authorJon <jonathan.bailey1@ibm.com>
Mon, 23 Jun 2025 12:57:20 +0000 (13:57 +0100)
committerJon Bailey <jonathan.bailey1@ibm.com>
Tue, 15 Jul 2025 08:20:47 +0000 (09:20 +0100)
Remove warnings about there not being an application enabled produced by ceph for pools that are created by ceph_test_rados_io_sequence by setting an application after creation of pools make by the test tool.

Signed-off-by: Jon Bailey <jonathan.bailey1@ibm.com>
src/common/json/OSDStructures.cc
src/common/json/OSDStructures.h
src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc
src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h

index ecf382a75495d2a26980229148bcc0f64738bf25..874c314f5dd125b419c64222e9553c479447ea86 100644 (file)
@@ -183,4 +183,21 @@ void InjectECClearParityRead::dump(Formatter* f) const {
 void InjectECClearParityRead::decode_json(JSONObj* obj) {
   JSONDecoder::decode_json("pool", pool, obj);
   JSONDecoder::decode_json("objname", objname, obj);
+}
+
+void OSDEnableApplicationRequest::dump(Formatter* f) const {
+  encode_json("prefix", "osd pool application enable", f);
+  encode_json("pool", pool, f);
+  encode_json("app", app, f);
+  encode_json("yes_i_really_mean_it", yes_i_really_mean_it, f);
+  encode_json("key", key, f);
+  encode_json("value", value, f);
+}
+
+void OSDEnableApplicationRequest::decode_json(JSONObj* obj) {
+  JSONDecoder::decode_json("pool", pool, obj);
+  JSONDecoder::decode_json("app", app, obj);
+  JSONDecoder::decode_json("yes_i_really_mean_it", yes_i_really_mean_it, obj);
+  JSONDecoder::decode_json("key", key, obj);
+  JSONDecoder::decode_json("value", value, obj);
 }
\ No newline at end of file
index a521b7ab5443f2f79d67a1c34dd8070d2d3ab5fa..ea94a2bd6414f9ee27cee848b2fea830a1e84162 100644 (file)
@@ -113,6 +113,17 @@ struct OSDSetRequest {
   void decode_json(JSONObj* obj);
 };
 
+  struct OSDEnableApplicationRequest {
+    std::string pool;
+    std::string app;
+    std::optional<bool> yes_i_really_mean_it;
+    std::optional<std::string> key;
+    std::optional<std::string> value;
+
+    void dump(Formatter* f) const;
+    void decode_json(JSONObj* obj);
+  };
+
 // These structures are sent directly to the relevant OSD
 // rather than the monitor
 template <io_exerciser::InjectOpType op_type>
index 396ec815afaff5dee6274346866c18a5f1f50a83..3233c84ce2ad853a1b8ac39df95dd3f5bf235b03 100644 (file)
@@ -847,6 +847,8 @@ const std::string ceph::io_sequence::tester::SelectErasurePool::select() {
       configureServices(allow_pool_autoscaling, allow_pool_balancer,
                         allow_pool_deep_scrubbing, allow_pool_scrubbing,
                         test_recovery);
+
+      setApplication(created_pool_name);
     }
   }
 
@@ -872,6 +874,21 @@ std::string ceph::io_sequence::tester::SelectErasurePool::create() {
   return pool_name;
 }
 
+void ceph::io_sequence::tester::SelectErasurePool::setApplication(
+    const std::string& pool_name) {
+  bufferlist inbl, outbl;
+  auto formatter = std::make_shared<JSONFormatter>(false);
+
+  ceph::messaging::osd::OSDEnableApplicationRequest
+  enableApplicationRequest{pool_name, "rados"};
+
+  int rc = send_mon_command(enableApplicationRequest, rados,
+                            "OSDEnableApplicationRequest", inbl, &outbl,
+                            formatter.get());
+
+  ceph_assert(rc == 0);
+}
+
 void ceph::io_sequence::tester::SelectErasurePool::configureServices(
     bool allow_pool_autoscaling,
     bool allow_pool_balancer,
index 16fe6d7b778d1bbae798ee5b3b4b9728ffc8bf18..e9e11db368a6667ce5fe444306a4dfd69500b4ad 100644 (file)
@@ -392,11 +392,6 @@ class SelectErasurePool : public ProgramOptionReader<std::string> {
                     bool disable_pool_ec_optimizations);
   const std::string select() override;
   std::string create();
-  void configureServices(bool allow_pool_autoscaling,
-                         bool allow_pool_balancer,
-                         bool allow_pool_deep_scrubbing,
-                         bool allow_pool_scrubbing,
-                         bool test_recovery);
 
   inline bool get_allow_pool_autoscaling() { return allow_pool_autoscaling; }
   inline bool get_allow_pool_balancer() { return allow_pool_balancer; }
@@ -425,6 +420,14 @@ class SelectErasurePool : public ProgramOptionReader<std::string> {
   SelectErasureProfile sep;
 
   std::optional<Profile> profile;
+
+  void configureServices(bool allow_pool_autoscaling,
+                         bool allow_pool_balancer,
+                         bool allow_pool_deep_scrubbing,
+                         bool allow_pool_scrubbing,
+                         bool test_recovery);
+
+ void setApplication(const std::string& pool_name);
 };
 
 class TestObject {