@@ -794,7 +794,7 @@ ceph::io_sequence::tester::SelectErasurePool::SelectErasurePool(
794794 bool allow_pool_deep_scrubbing,
795795 bool allow_pool_scrubbing,
796796 bool test_recovery,
797- bool disable_pool_ec_optimizations )
797+ bool allow_pool_ec_optimizations )
798798 : ProgramOptionReader<std::string>(vm, " pool" ),
799799 rados(rados),
800800 dry_run(dry_run),
@@ -803,7 +803,7 @@ ceph::io_sequence::tester::SelectErasurePool::SelectErasurePool(
803803 allow_pool_deep_scrubbing(allow_pool_deep_scrubbing),
804804 allow_pool_scrubbing(allow_pool_scrubbing),
805805 test_recovery(test_recovery),
806- disable_pool_ec_optimizations(disable_pool_ec_optimizations ),
806+ allow_pool_ec_optimizations(allow_pool_ec_optimizations ),
807807 first_use(true ),
808808 sep{cct, rng, vm, rados, dry_run, first_use} {
809809 if (isForced ()) {
@@ -849,9 +849,10 @@ const std::string ceph::io_sequence::tester::SelectErasurePool::select() {
849849 }
850850
851851 if (!dry_run) {
852- configureServices (allow_pool_autoscaling, allow_pool_balancer,
852+ configureServices (force_value.value_or (created_pool_name),
853+ allow_pool_autoscaling, allow_pool_balancer,
853854 allow_pool_deep_scrubbing, allow_pool_scrubbing,
854- test_recovery);
855+ allow_pool_ec_optimizations, true , test_recovery);
855856
856857 setApplication (created_pool_name);
857858 }
@@ -868,7 +869,7 @@ std::string ceph::io_sequence::tester::SelectErasurePool::create() {
868869 std::string pool_name;
869870 profile = sep.select ();
870871 pool_name = fmt::format (" testpool-pr{}{}" , profile->name ,
871- disable_pool_ec_optimizations? " _no_ec_opt " :" " );
872+ allow_pool_ec_optimizations? " " :" _no_ec_opt " );
872873
873874 ceph::messaging::osd::OSDECPoolCreateRequest pool_create_request{
874875 pool_name, " erasure" , 8 , 8 , profile->name };
@@ -895,10 +896,13 @@ void ceph::io_sequence::tester::SelectErasurePool::setApplication(
895896}
896897
897898void ceph::io_sequence::tester::SelectErasurePool::configureServices (
899+ const std::string& pool_name,
898900 bool allow_pool_autoscaling,
899901 bool allow_pool_balancer,
900902 bool allow_pool_deep_scrubbing,
901903 bool allow_pool_scrubbing,
904+ bool allow_pool_ec_optimizations,
905+ bool allow_pool_ec_overwrites,
902906 bool test_recovery) {
903907 int rc;
904908 bufferlist inbl, outbl;
@@ -942,12 +946,34 @@ void ceph::io_sequence::tester::SelectErasurePool::configureServices(
942946
943947 if (!allow_pool_scrubbing) {
944948 ceph::messaging::osd::OSDSetRequest no_scrub_request{" noscrub" ,
945- std::nullopt };
949+ std::nullopt };
946950 rc = send_mon_command (no_scrub_request, rados, " OSDSetRequest" , inbl,
947951 &outbl, formatter.get ());
948952 ceph_assert (rc == 0 );
949953 }
950954
955+ if (allow_pool_ec_optimizations) {
956+ ceph::messaging::osd::OSDPoolSetRequest
957+ allow_ec_optimisations_request{pool_name,
958+ " allow_ec_optimizations" ,
959+ " true" ,
960+ std::nullopt };
961+ rc = send_mon_command (allow_ec_optimisations_request, rados,
962+ " OSDPoolSetRequest" , inbl, &outbl, formatter.get ());
963+ ceph_assert (rc == 0 );
964+ }
965+
966+ if (allow_pool_ec_overwrites) {
967+ ceph::messaging::osd::OSDPoolSetRequest
968+ allow_ec_optimisations_request{pool_name,
969+ " allow_ec_overwrites" ,
970+ " true" ,
971+ std::nullopt };
972+ rc = send_mon_command (allow_ec_optimisations_request, rados,
973+ " OSDPoolSetRequest" , inbl, &outbl, formatter.get ());
974+ ceph_assert (rc == 0 );
975+ }
976+
951977 if (test_recovery) {
952978 ceph::messaging::config::ConfigSetRequest bluestore_debug_request{
953979 " global" , " bluestore_debug_inject_read_err" , " true" , std::nullopt };
@@ -1105,7 +1131,7 @@ ceph::io_sequence::tester::TestRunner::TestRunner(
11051131 vm.contains (" allow_pool_deep_scrubbing" ),
11061132 vm.contains (" allow_pool_scrubbing" ),
11071133 vm.contains (" testrecovery" ),
1108- vm.contains (" disable_pool_ec_optimizations" )},
1134+ ! vm.contains (" disable_pool_ec_optimizations" )},
11091135 snt{rng, vm, " threads" , true },
11101136 ssr{vm} {
11111137 dout (0 ) << " Test using seed " << seed << dendl;
@@ -1127,7 +1153,6 @@ ceph::io_sequence::tester::TestRunner::TestRunner(
11271153 allow_pool_balancer = vm.contains (" allow_pool_balancer" );
11281154 allow_pool_deep_scrubbing = vm.contains (" allow_pool_deep_scrubbing" );
11291155 allow_pool_scrubbing = vm.contains (" allow_pool_scrubbing" );
1130- disable_pool_ec_optimizations = vm.contains (" disable_pool_ec_optimizations" );
11311156
11321157 if (testrecovery && (num_objects > 1 )) {
11331158 throw std::invalid_argument (" testrecovery option not allowed if parallel is"
0 commit comments