const std::string& pool, const std::string& oid,
const std::optional<std::vector<int>>& cached_shard_order,
uint64_t block_size, int seed, int threads, ceph::mutex& lock,
- ceph::condition_variable& cond)
+ ceph::condition_variable& cond, bool ec_optimizations)
: Model(oid, block_size),
rados(rados),
asio(asio),
rc = rados.ioctx_create(pool.c_str(), io);
ceph_assert(rc == 0);
allow_ec_overwrites(true);
+ if (ec_optimizations) {
+ allow_ec_optimizations();
+ }
}
RadosIo::~RadosIo() {}
ceph_assert(rc == 0);
}
+void RadosIo::allow_ec_optimizations()
+{
+ int rc;
+ bufferlist inbl, outbl;
+ std::string cmdstr =
+ "{\"prefix\": \"osd pool set\", \"pool\": \"" + pool + "\", \
+ \"var\": \"allow_ec_optimizations\", \"val\": \"true\"}";
+ rc = rados.mon_command(cmdstr, inbl, &outbl, nullptr);
+ ceph_assert(rc == 0);
+}
+
template <int N>
RadosIo::AsyncOpInfo<N>::AsyncOpInfo(const std::array<uint64_t, N>& offset,
const std::array<uint64_t, N>& length)
#include <boost/asio/io_context.hpp>
#include <iostream>
-#include <map>
#include <vector>
#include "common/Formatter.h"
#include "common/ceph_json.h"
#include "common/debug.h"
#include "common/dout.h"
+#include "common/split.h"
+#include "common/strtol.h" // for strict_iecstrtoll()
+#include "common/ceph_json.h"
+#include "common/Formatter.h"
+
#include "common/io_exerciser/DataGenerator.h"
#include "common/io_exerciser/EcIoSequence.h"
#include "common/io_exerciser/IoOp.h"
#include "common/json/BalancerStructures.h"
#include "common/json/ConfigStructures.h"
#include "common/json/OSDStructures.h"
-#include "common/split.h"
-#include "common/strtol.h" // for strict_iecstrtoll()
-#include "erasure-code/ErasureCodePlugin.h"
#include "fmt/format.h"
#include "global/global_context.h"
#include "global/global_init.h"
bool allow_pool_balancer,
bool allow_pool_deep_scrubbing,
bool allow_pool_scrubbing,
- bool test_recovery)
+ bool test_recovery,
+ bool disable_pool_ec_optimizations)
: ProgramOptionReader<std::string>(vm, "pool"),
rados(rados),
dry_run(dry_run),
allow_pool_deep_scrubbing(allow_pool_deep_scrubbing),
allow_pool_scrubbing(allow_pool_scrubbing),
test_recovery(test_recovery),
+ disable_pool_ec_optimizations(disable_pool_ec_optimizations),
first_use(true),
sep{cct, rng, vm, rados, dry_run, first_use} {
if (isForced()) {
std::string pool_name;
profile = sep.select();
- pool_name = fmt::format("testpool-pr{}", profile->name);
+ pool_name = fmt::format("testpool-pr{}{}", profile->name,
+ disable_pool_ec_optimizations?"_no_ec_opt":"");
ceph::messaging::osd::OSDECPoolCreateRequest pool_create_request{
pool_name, "erasure", 8, 8, profile->name};
exerciser_model = std::make_unique<ceph::io_exerciser::RadosIo>(
rados, asio, pool, oid, cached_shard_order, sbs.select(), rng(),
- threads, lock, cond);
+ threads, lock, cond, spo.get_allow_pool_ec_optimizations());
dout(0) << "= " << oid << " pool=" << pool << " threads=" << threads
<< " blocksize=" << exerciser_model->get_block_size() << " ="
<< dendl;
vm.contains("allow_pool_balancer"),
vm.contains("allow_pool_deep_scrubbing"),
vm.contains("allow_pool_scrubbing"),
- vm.contains("test_recovery")},
+ vm.contains("test_recovery"),
+ vm.contains("disable_pool_ec_optimizations")},
snt{rng, vm, "threads", true},
ssr{vm} {
dout(0) << "Test using seed " << seed << dendl;
allow_pool_balancer = vm.contains("allow_pool_balancer");
allow_pool_deep_scrubbing = vm.contains("allow_pool_deep_scrubbing");
allow_pool_scrubbing = vm.contains("allow_pool_scrubbing");
+ disable_pool_ec_optimizations = vm.contains("disable_pool_ec_optimizations");
if (!dryrun) {
guard.emplace(boost::asio::make_work_guard(asio));
model = std::make_unique<ceph::io_exerciser::RadosIo>(
rados, asio, pool, object_name, osd_map_reply.acting, sbs.select(), rng(),
1, // 1 thread
- lock, cond);
+ lock, cond,
+ spo.get_allow_pool_ec_optimizations());
}
while (!done) {
bool allow_pool_balancer,
bool allow_pool_deep_scrubbing,
bool allow_pool_scrubbing,
- bool test_recovery);
+ bool test_recovery,
+ bool disable_pool_ec_optimizations);
const std::string select() override;
std::string create();
void configureServices(bool allow_pool_autoscaling,
return allow_pool_deep_scrubbing;
}
inline bool get_allow_pool_scrubbing() { return allow_pool_scrubbing; }
-
+ inline bool get_allow_pool_ec_optimizations() {
+ return !disable_pool_ec_optimizations;
+ }
inline std::optional<Profile> getProfile() { return profile; }
private:
bool allow_pool_deep_scrubbing;
bool allow_pool_scrubbing;
bool test_recovery;
+ bool disable_pool_ec_optimizations;
bool first_use;
bool allow_pool_balancer;
bool allow_pool_deep_scrubbing;
bool allow_pool_scrubbing;
+ bool disable_pool_ec_optimizations;
bool show_sequence;
bool show_help;