All other pool initialisation happens straight after pool creation, however these two items happen later on. This is just due to them being the first two rest calls added. We now have better and more logical places for this code and this commit is moving it into this structure.
Signed-off-by: Jon Bailey <jonathan.bailey1@ibm.com>
int rc;
rc = rados.ioctx_create(pool.c_str(), io);
ceph_assert(rc == 0);
- allow_ec_overwrites(true);
- if (ec_optimizations) {
- allow_ec_optimizations();
- }
}
RadosIo::~RadosIo() {}
}
}
-void RadosIo::allow_ec_overwrites(bool allow) {
- int rc;
- bufferlist inbl, outbl;
- std::string cmdstr = "{\"prefix\": \"osd pool set\", \"pool\": \"" + pool +
- "\", \
- \"var\": \"allow_ec_overwrites\", \"val\": \"" +
- (allow ? "true" : "false") + "\"}";
- rc = rados.mon_command(cmdstr, inbl, &outbl, nullptr);
- 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)
case OpType::Consistency: {
start_io();
+ ceph_assert(cc);
bool is_consistent =
- cc->single_read_and_check_consistency(oid, block_size, 0, 0);
+ cc->single_read_and_check_consistency(oid, block_size, 0, 0);
+ if (!is_consistent) {
+ std::stringstream strstream;
+ cc->print_results(strstream);
+ std::cerr << strstream.str() << std::endl;
+ }
ceph_assert(is_consistent);
finish_io();
break;
JSONDecoder::decode_json("allow_ec_optimizations", allow_ec_optimizations, obj);
}
+void OSDPoolSetRequest::dump(Formatter* f) const {
+ encode_json("prefix", "osd pool set", f);
+ encode_json("pool", pool, f);
+ encode_json("var", var, f);
+ encode_json("val", val, f);
+ encode_json("yes_i_really_mean_it", yes_i_really_mean_it, f);
+}
+
+void OSDPoolSetRequest::decode_json(JSONObj* obj) {
+ JSONDecoder::decode_json("pool", pool, obj);
+ JSONDecoder::decode_json("var", var, obj);
+ JSONDecoder::decode_json("val", val, obj);
+ JSONDecoder::decode_json("yes_i_really_mean_it", yes_i_really_mean_it, obj);
+}
+
void OSDECProfileGetRequest::dump(Formatter* f) const {
encode_json("prefix", "osd erasure-code-profile get", f);
encode_json("name", name, f);
void decode_json(JSONObj* obj);
};
+struct OSDPoolSetRequest {
+ std::string pool;
+ std::string var;
+ std::optional<std::string> val;
+ std::optional<bool> yes_i_really_mean_it = std::nullopt;
+
+ void dump(Formatter* f) const;
+ void decode_json(JSONObj* obj);
+};
+
struct OSDECProfileGetRequest {
std::string name;
std::string format = "json";
bool allow_pool_deep_scrubbing,
bool allow_pool_scrubbing,
bool test_recovery,
- bool disable_pool_ec_optimizations)
+ bool allow_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),
+ allow_pool_ec_optimizations(allow_pool_ec_optimizations),
first_use(true),
sep{cct, rng, vm, rados, dry_run, first_use} {
if (isForced()) {
}
if (!dry_run) {
- configureServices(allow_pool_autoscaling, allow_pool_balancer,
+ configureServices(force_value.value_or(created_pool_name),
+ allow_pool_autoscaling, allow_pool_balancer,
allow_pool_deep_scrubbing, allow_pool_scrubbing,
- test_recovery);
+ allow_pool_ec_optimizations, true, test_recovery);
setApplication(created_pool_name);
}
std::string pool_name;
profile = sep.select();
pool_name = fmt::format("testpool-pr{}{}", profile->name,
- disable_pool_ec_optimizations?"_no_ec_opt":"");
+ allow_pool_ec_optimizations?"":"_no_ec_opt");
ceph::messaging::osd::OSDECPoolCreateRequest pool_create_request{
pool_name, "erasure", 8, 8, profile->name};
}
void ceph::io_sequence::tester::SelectErasurePool::configureServices(
+ const std::string& pool_name,
bool allow_pool_autoscaling,
bool allow_pool_balancer,
bool allow_pool_deep_scrubbing,
bool allow_pool_scrubbing,
+ bool allow_pool_ec_optimizations,
+ bool allow_pool_ec_overwrites,
bool test_recovery) {
int rc;
bufferlist inbl, outbl;
if (!allow_pool_scrubbing) {
ceph::messaging::osd::OSDSetRequest no_scrub_request{"noscrub",
- std::nullopt};
+ std::nullopt};
rc = send_mon_command(no_scrub_request, rados, "OSDSetRequest", inbl,
&outbl, formatter.get());
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 (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) {
ceph::messaging::config::ConfigSetRequest bluestore_debug_request{
"global", "bluestore_debug_inject_read_err", "true", std::nullopt};
vm.contains("allow_pool_deep_scrubbing"),
vm.contains("allow_pool_scrubbing"),
vm.contains("testrecovery"),
- vm.contains("disable_pool_ec_optimizations")},
+ !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 (testrecovery && (num_objects > 1)) {
throw std::invalid_argument("testrecovery option not allowed if parallel is"
bool allow_pool_deep_scrubbing,
bool allow_pool_scrubbing,
bool test_recovery,
- bool disable_pool_ec_optimizations);
+ bool allow_pool_ec_optimizations);
const std::string select() override;
std::string create();
}
inline bool get_allow_pool_scrubbing() { return allow_pool_scrubbing; }
inline bool get_allow_pool_ec_optimizations() {
- return !disable_pool_ec_optimizations;
+ return allow_pool_ec_optimizations;
}
inline std::optional<Profile> getProfile() { return profile; }
bool allow_pool_deep_scrubbing;
bool allow_pool_scrubbing;
bool test_recovery;
- bool disable_pool_ec_optimizations;
+ bool allow_pool_ec_optimizations;
bool first_use;
std::optional<Profile> profile;
- void configureServices(bool allow_pool_autoscaling,
+ void configureServices(const std::string& pool_name,
+ bool allow_pool_autoscaling,
bool allow_pool_balancer,
bool allow_pool_deep_scrubbing,
bool allow_pool_scrubbing,
+ bool disable_pool_ec_optimizations,
+ bool allow_pool_ec_overwrites,
bool test_recovery);
void setApplication(const std::string& pool_name);
bool allow_pool_balancer;
bool allow_pool_deep_scrubbing;
bool allow_pool_scrubbing;
- bool disable_pool_ec_optimizations;
bool show_sequence;
bool show_help;