From: Samuel Just Date: Fri, 22 Nov 2013 19:20:23 +0000 (-0800) Subject: OSDMonitor: add debug_fake_ec_pool X-Git-Tag: v0.78~286^2~52 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=393a035b868f5ae76bd1b25fcb4354f8873336c0;p=ceph.git 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 --- diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index 6d476322da25..18ac11fc0ee2 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -519,7 +519,7 @@ COMMAND("osd pool get " \ "get pool parameter ", "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 to ", "osd", "rw", "cli,rest") // 'val' is a CephString because it can include a unit. Perhaps diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index a4ed683085d2..d682b24eab86 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3006,6 +3006,11 @@ int OSDMonitor::prepare_command_pool_set(map &cmdmap, } BloomHitSet::Params *bloomp = static_cast(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; diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index cf11aa1437e7..cf9b9b8854af 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -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; }