mirror of
https://github.com/ceph/ceph
synced 2025-01-11 21:50:26 +00:00
OSDMonitor: add debug_fake_ec_pool
This flag will cause ReplicatedPG to act as though the pool were actually an EC pool in that operations will be restricted to operations which can be locally rolled back thereby allowing us to test the ReplicatedPG local log rollback mechanisms independent of EC. It will also cause ReplicatedPG to use the async read mechanism on the PGBackend implementation once it is implemented. Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
parent
a1ee1ee716
commit
393a035b86
@ -519,7 +519,7 @@ COMMAND("osd pool get " \
|
||||
"get pool parameter <var>", "osd", "r", "cli,rest")
|
||||
COMMAND("osd pool set " \
|
||||
"name=pool,type=CephPoolname " \
|
||||
"name=var,type=CephChoices,strings=size|min_size|crash_replay_interval|pg_num|pgp_num|crush_ruleset|hashpspool|hit_set_type|hit_set_period|hit_set_count|hit_set_fpp " \
|
||||
"name=var,type=CephChoices,strings=size|min_size|crash_replay_interval|pg_num|pgp_num|crush_ruleset|hashpspool|hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|debug_fake_ec_pool " \
|
||||
"name=val,type=CephString", \
|
||||
"set pool parameter <var> to <val>", "osd", "rw", "cli,rest")
|
||||
// 'val' is a CephString because it can include a unit. Perhaps
|
||||
|
@ -3006,6 +3006,11 @@ int OSDMonitor::prepare_command_pool_set(map<string,cmd_vartype> &cmdmap,
|
||||
}
|
||||
BloomHitSet::Params *bloomp = static_cast<BloomHitSet::Params*>(p.hit_set_params.impl.get());
|
||||
bloomp->set_fpp(f);
|
||||
} else if (var == "debug_fake_ec_pool") {
|
||||
if (val == "true" || (interr.empty() && n == 1)) {
|
||||
p.flags |= pg_pool_t::FLAG_DEBUG_FAKE_EC_POOL;
|
||||
}
|
||||
ss << " pool " << pool << " set debug_fake_ec_pool";
|
||||
} else {
|
||||
ss << "unrecognized variable '" << var << "'";
|
||||
return -EINVAL;
|
||||
|
@ -719,12 +719,14 @@ struct pg_pool_t {
|
||||
enum {
|
||||
FLAG_HASHPSPOOL = 1, // hash pg seed and pool together (instead of adding)
|
||||
FLAG_FULL = 2, // pool is full
|
||||
FLAG_DEBUG_FAKE_EC_POOL = 1<<2, // require ReplicatedPG to act like an EC pg
|
||||
};
|
||||
|
||||
static const char *get_flag_name(int f) {
|
||||
switch (f) {
|
||||
case FLAG_HASHPSPOOL: return "hashpspool";
|
||||
case FLAG_FULL: return "full";
|
||||
case FLAG_DEBUG_FAKE_EC_POOL: return "require_local_rollback";
|
||||
default: return "???";
|
||||
}
|
||||
}
|
||||
@ -847,6 +849,12 @@ public:
|
||||
void dump(Formatter *f) const;
|
||||
|
||||
uint64_t get_flags() const { return flags; }
|
||||
|
||||
/// This method will later return true for ec pools as well
|
||||
bool ec_pool() const {
|
||||
return flags & FLAG_DEBUG_FAKE_EC_POOL;
|
||||
}
|
||||
|
||||
unsigned get_type() const { return type; }
|
||||
unsigned get_size() const { return size; }
|
||||
unsigned get_min_size() const { return min_size; }
|
||||
|
Loading…
Reference in New Issue
Block a user