]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: add debug_fake_ec_pool
authorSamuel Just <sam.just@inktank.com>
Fri, 22 Nov 2013 19:20:23 +0000 (11:20 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 22 Jan 2014 22:39:13 +0000 (14:39 -0800)
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>
src/mon/MonCommands.h
src/mon/OSDMonitor.cc
src/osd/osd_types.h

index 6d476322da2592f9957325febf6be24e805ff0d3..18ac11fc0ee2ed199222fc76af2fbd66bb1862d1 100644 (file)
@@ -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
index a4ed683085d2a30f34a2328e549a79dc1c2f02d3..d682b24eab860a30d1a0e0096b44c0ab2fca24ae 100644 (file)
@@ -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;
index cf11aa1437e76d79b12abc7780dc0dbd7b17ae1c..cf9b9b8854afa39d5082991fd0eec717754dd49b 100644 (file)
@@ -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; }