]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Throw error when using ec optimisations with an unsupported plugin 65875/head
authorMatty Williams <Matty.Williams@ibm.com>
Thu, 9 Oct 2025 16:05:56 +0000 (17:05 +0100)
committerMatty Williams <Matty.Williams@ibm.com>
Wed, 25 Mar 2026 14:06:46 +0000 (14:06 +0000)
Throw an invalid argument error (instead of asserting) when ceph_test_rados_io_sequence attempts to enable ec optimisations with a plugin that does not support ec optimisations (such as LRC).
Small (unrelated) tweaks to code in the same file.

Fixes: https://tracker.ceph.com/issues/73483
Signed-off-by: Matty Williams <Matty.Williams@ibm.com>
src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc

index 709f6e5e6932e14433b6fbd92d5ea711ef964bb8..896d08908afb0e4e361b3251138ee67788298d8b 100644 (file)
@@ -136,8 +136,8 @@ constexpr std::string_view usage[] = {
     "                            --objectsize <min,max> --threads <t>",
     "ceph_test_rados_io_sequence --blocksize <b> --pool <p> --object <oid>",
     "                            --objectsize <min,max> --threads <t>",
-    "\tCustomize the test, if a pool is specified then it defines the",
-    "\tReplicated/EC configuration",
+    "\t Customize the test, if a pool is specified then it defines the",
+    "\t Replicated/EC configuration",
     "",
     "ceph_test_rados_io_sequence --listsequence",
     "\t Display list of supported I/O sequences",
@@ -175,8 +175,8 @@ constexpr std::string_view usage[] = {
 
 po::options_description get_options_description() {
   po::options_description desc("ceph_test_rados_io options");
-  desc.add_options()("help,h", "show help message")("listsequence,l",
-                                                    "show list of sequences")(
+  desc.add_options()("help,h", "show help message")(
+      "listsequence,l", "show list of sequences")(
       "dryrun,d", "test sequence, do not issue any I/O")(
       "verbose", "more verbose output during test")(
       "sequence,s", po::value<SequencePair>(), "test specified sequence range")(
@@ -990,16 +990,20 @@ void ceph::io_sequence::tester::SelectErasurePool::configureServices(
                                         std::nullopt};
       rc = send_mon_command(allow_ec_optimisations_request, rados,
                             "OSDPoolSetRequest", {}, &outbl, formatter.get());
-      ceph_assert(rc == 0);
+      if (rc != 0) {
+        throw std::invalid_argument("Failed to enable EC optimisations, "
+                                    "the specified plugin type may not "
+                                    "support them");
+      }
     }
 
     if (allow_pool_ec_overwrites) {
       ceph::messaging::osd::OSDPoolSetRequest
-          allow_ec_optimisations_request{pool_name,
+          allow_ec_overwrites_request{pool_name,
                                         "allow_ec_overwrites",
                                         "true",
                                         std::nullopt};
-      rc = send_mon_command(allow_ec_optimisations_request, rados,
+      rc = send_mon_command(allow_ec_overwrites_request, rados,
                             "OSDPoolSetRequest", {}, &outbl, formatter.get());
       ceph_assert(rc == 0);
     }