"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",
- "\tReplica/EC configuration",
+ "\tReplicated/EC configuration",
"",
"ceph_test_rados_io_sequence --listsequence",
"\t Display list of supported I/O sequences",
bool allow_pool_balancer,
bool allow_pool_deep_scrubbing,
bool allow_pool_scrubbing,
+ bool check_consistency,
bool test_recovery,
bool allow_pool_ec_optimizations)
: ProgramOptionReader<std::string>(vm, "pool"),
allow_pool_balancer(allow_pool_balancer),
allow_pool_deep_scrubbing(allow_pool_deep_scrubbing),
allow_pool_scrubbing(allow_pool_scrubbing),
+ check_consistency(check_consistency),
test_recovery(test_recovery),
allow_pool_ec_optimizations(allow_pool_ec_optimizations),
first_use(true),
ceph::messaging::osd::OSDPoolGetReply pool_get_reply;
pool_get_reply.decode_json(&p);
- profile = sep.selectExistingProfile(pool_get_reply.erasure_code_profile);
+ if (pool_get_reply.erasure_code_profile.has_value()) {
+ pool_type = pg_pool_t::TYPE_ERASURE;
+ profile = sep.selectExistingProfile(*pool_get_reply.erasure_code_profile);
+ } else {
+ pool_type = pg_pool_t::TYPE_REPLICATED;
+ if (check_consistency) {
+ throw std::invalid_argument(fmt::format("checkconsistency option not "
+ "allowed if using a {} pool",
+ pg_pool_t::get_type_name(pool_type)));
+ }
+ }
} else {
+ pool_type = pg_pool_t::TYPE_ERASURE;
created_pool_name = create();
}
if (!dry_run) {
- configureServices(force_value.value_or(created_pool_name),
+ configureServices(force_value.value_or(created_pool_name), pool_type,
allow_pool_autoscaling, allow_pool_balancer,
allow_pool_deep_scrubbing, allow_pool_scrubbing,
allow_pool_ec_optimizations, true, test_recovery);
- setApplication(created_pool_name);
+ if (!force_value)
+ {
+ setApplication(created_pool_name);
+ }
}
}
void ceph::io_sequence::tester::SelectErasurePool::configureServices(
const std::string& pool_name,
+ PoolType pool_type,
bool allow_pool_autoscaling,
bool allow_pool_balancer,
bool allow_pool_deep_scrubbing,
ceph_assert(rc == 0);
}
- if (allow_pool_ec_optimizations) {
- ceph::messaging::osd::OSDPoolSetRequest
- allow_ec_optimisations_request{pool_name,
- "allow_ec_optimizations",
- "true",
- std::nullopt};
- rc = send_mon_command(allow_ec_optimisations_request, rados,
- "OSDPoolSetRequest", inbl, &outbl, formatter.get());
- ceph_assert(rc == 0);
- }
+ if (pool_type == pg_pool_t::TYPE_ERASURE)
+ {
+ if (allow_pool_ec_optimizations) {
+ ceph::messaging::osd::OSDPoolSetRequest
+ allow_ec_optimisations_request{pool_name,
+ "allow_ec_optimizations",
+ "true",
+ std::nullopt};
+ rc = send_mon_command(allow_ec_optimisations_request, rados,
+ "OSDPoolSetRequest", inbl, &outbl, formatter.get());
+ ceph_assert(rc == 0);
+ }
- if (allow_pool_ec_overwrites) {
- ceph::messaging::osd::OSDPoolSetRequest
- allow_ec_optimisations_request{pool_name,
- "allow_ec_overwrites",
- "true",
- std::nullopt};
- rc = send_mon_command(allow_ec_optimisations_request, rados,
- "OSDPoolSetRequest", inbl, &outbl, formatter.get());
- ceph_assert(rc == 0);
+ if (allow_pool_ec_overwrites) {
+ ceph::messaging::osd::OSDPoolSetRequest
+ allow_ec_optimisations_request{pool_name,
+ "allow_ec_overwrites",
+ "true",
+ std::nullopt};
+ rc = send_mon_command(allow_ec_optimisations_request, rados,
+ "OSDPoolSetRequest", inbl, &outbl, formatter.get());
+ ceph_assert(rc == 0);
+ }
}
if (test_recovery) {
} else {
const std::string pool = spo.select();
if (!dryrun) {
- ceph_assert(spo.getProfile());
- pool_km = spo.getProfile()->km;
- if (spo.getProfile()->mapping && spo.getProfile()->layers) {
- pool_mappinglayers = {*spo.getProfile()->mapping,
- *spo.getProfile()->layers};
+ if (!spo.is_replicated_pool()) {
+ ceph_assert(spo.getProfile());
+ pool_km = spo.getProfile()->km;
+ if (spo.getProfile()->mapping && spo.getProfile()->layers) {
+ pool_mappinglayers = {*spo.getProfile()->mapping,
+ *spo.getProfile()->layers};
+ }
}
}
exerciser_model = std::make_unique<ceph::io_exerciser::RadosIo>(
rados, asio, pool, oid, cached_shard_order, sbs.select(), rng(),
- threads, lock, cond, spo.get_allow_pool_ec_optimizations());
+ threads, lock, cond, spo.is_replicated_pool(),
+ 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("checkconsistency"),
vm.contains("testrecovery"),
!vm.contains("disable_pool_ec_optimizations")},
snt{rng, vm, "threads", true},
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.is_replicated_pool(),
spo.get_allow_pool_ec_optimizations());
}
std::cerr << "Error: " << e.what() << std::endl;
return false;
}
+ catch (const std::invalid_argument &e) {
+ std::cerr << "Error: " << e.what() << std::endl;
+ return false;
+ }
}
if (!dryrun) {
rados.wait_for_latest_osdmap();