From: Matty Williams Date: Thu, 9 Oct 2025 16:05:56 +0000 (+0100) Subject: test: Throw error when using ec optimisations with an unsupported plugin X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=69442435006f343e59c1fdbcb2cfd9d112107e99;p=ceph.git test: Throw error when using ec optimisations with an unsupported plugin 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 --- diff --git a/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc b/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc index 709f6e5e6932..896d08908afb 100644 --- a/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc +++ b/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc @@ -136,8 +136,8 @@ constexpr std::string_view usage[] = { " --objectsize --threads ", "ceph_test_rados_io_sequence --blocksize --pool

--object ", " --objectsize --threads ", - "\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(), "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); }