]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd,mon: add pool FLAG_EC_OVERWRITES flag
authorSamuel Just <sjust@redhat.com>
Thu, 28 Apr 2016 23:50:12 +0000 (16:50 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 17 Nov 2016 18:40:17 +0000 (10:40 -0800)
For now, this is a white box testing flag to allow
us to start testing the supporting features before
ec overwrites can actually be implemented.

Signed-off-by: Samuel Just <sjust@redhat.com>
Signed-off-by: Tomy Cheru <tomy.cheru@sandisk.com>
src/mon/MonCommands.h
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h
src/osd/osd_types.h

index ab60dd02317b2fa88ff76b6161faa48347de8dec..5fa2079eed8c6ca7c1de8b1d7267dada07a8ae23 100644 (file)
@@ -739,7 +739,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|nodelete|nopgchange|nosizechange|write_fadvise_dontneed|noscrub|nodeep-scrub|hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|use_gmt_hitset|debug_fake_ec_pool|target_max_bytes|target_max_objects|cache_target_dirty_ratio|cache_target_dirty_high_ratio|cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age|auid|min_read_recency_for_promote|min_write_recency_for_promote|fast_read|hit_set_grade_decay_rate|hit_set_search_last_n|scrub_min_interval|scrub_max_interval|deep_scrub_interval|recovery_priority|recovery_op_priority|scrub_priority|compression_mode|compression_algorithm|compression_required_ratio|compression_max_blob_size|compression_min_blob_size|csum_type|csum_min_block|csum_max_block " \
+       "name=var,type=CephChoices,strings=size|min_size|crash_replay_interval|pg_num|pgp_num|crush_ruleset|hashpspool|nodelete|nopgchange|nosizechange|write_fadvise_dontneed|noscrub|nodeep-scrub|hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|use_gmt_hitset|debug_fake_ec_pool|target_max_bytes|target_max_objects|cache_target_dirty_ratio|cache_target_dirty_high_ratio|cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age|auid|min_read_recency_for_promote|min_write_recency_for_promote|fast_read|hit_set_grade_decay_rate|hit_set_search_last_n|scrub_min_interval|scrub_max_interval|deep_scrub_interval|recovery_priority|recovery_op_priority|scrub_priority|compression_mode|compression_algorithm|compression_required_ratio|compression_max_blob_size|compression_min_blob_size|csum_type|csum_min_block|csum_max_block|debug_white_box_testing_ec_overwrites " \
        "name=val,type=CephString " \
        "name=force,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \
        "set pool parameter <var> to <val>", "osd", "rw", "cli,rest")
index 7d8d259f1a61c9c00726120ec8c436a7e4ad45c5..6fa5fa67c1819530f9af3cd619cbb0c08a1ee160 100644 (file)
@@ -77,6 +77,7 @@ static ostream& _prefix(std::ostream *_dout, Monitor *mon, const OSDMap& osdmap)
 
 OSDMonitor::OSDMonitor(CephContext *cct, Monitor *mn, Paxos *p, const string& service_name)
  : PaxosService(mn, p, service_name),
+   cct(cct),
    inc_osd_cache(g_conf->mon_osd_cache_size),
    full_osd_cache(g_conf->mon_osd_cache_size),
    thrash_map(0), thrash_last_up_osd(-1),
@@ -5393,6 +5394,25 @@ int OSDMonitor::prepare_command_pool_set(map<string,cmd_vartype> &cmdmap,
       ss << "expecting value 'true' or '1'";
       return -EINVAL;
     }
+  } else if (var == "debug_white_box_testing_ec_overwrites") {
+    if (val == "true" || (interr.empty() && n == 1)) {
+      if (cct->check_experimental_feature_enabled(
+           "debug_white_box_testing_ec_overwrites")) {
+       p.flags |= pg_pool_t::FLAG_EC_OVERWRITES;
+      } else {
+       ss << "debug_white_box_testing_ec_overwrites is an experimental feature "
+          << "and must be enabled.  Note, this feature does not yet actually "
+          << "work.  This flag merely enables some of the preliminary support "
+          << "for testing purposes.";
+       return -ENOTSUP;
+      }
+    } else if (val == "false" || (interr.empty() && n == 0)) {
+      ss << "ec overwrites cannot be disabled once enabled";
+      return -EINVAL;
+    } else {
+      ss << "expecting value 'true', 'false', '0', or '1'";
+      return -EINVAL;
+    }
   } else if (var == "target_max_objects") {
     if (interr.length()) {
       ss << "error parsing int '" << val << "': " << interr;
index 8e55bf778d6f59d3676ebe88d8fe86e23d4ed910..103806175242a81c0948a2e4920fc552c6755820 100644 (file)
@@ -110,6 +110,7 @@ struct failure_info_t {
 };
 
 class OSDMonitor : public PaxosService {
+  CephContext *cct;
 public:
   OSDMap osdmap;
 
index 6454e69d6af2be0e6e6820f5c39ce6da2dd792ff..f6e05b8f86ba25b2011e7ec0c95248ee94942009 100644 (file)
@@ -1076,7 +1076,7 @@ struct pg_pool_t {
   enum {
     FLAG_HASHPSPOOL = 1<<0, // hash pg seed and pool together (instead of adding)
     FLAG_FULL       = 1<<1, // pool is full
-    //UNUSED = 1<<2,
+    FLAG_EC_OVERWRITES = 1<<2, // enables overwrites, once enabled, cannot be disabled
     FLAG_INCOMPLETE_CLONES = 1<<3, // may have incomplete clones (bc we are/were an overlay)
     FLAG_NODELETE = 1<<4, // pool can't be deleted
     FLAG_NOPGCHANGE = 1<<5, // pool's pg and pgp num can't be changed
@@ -1090,6 +1090,7 @@ struct pg_pool_t {
     switch (f) {
     case FLAG_HASHPSPOOL: return "hashpspool";
     case FLAG_FULL: return "full";
+    case FLAG_EC_OVERWRITES: return "ec_overwrites";
     case FLAG_INCOMPLETE_CLONES: return "incomplete_clones";
     case FLAG_NODELETE: return "nodelete";
     case FLAG_NOPGCHANGE: return "nopgchange";
@@ -1119,6 +1120,8 @@ struct pg_pool_t {
       return FLAG_HASHPSPOOL;
     if (name == "full")
       return FLAG_FULL;
+    if (name == "ec_overwrites")
+      return FLAG_EC_OVERWRITES;
     if (name == "incomplete_clones")
       return FLAG_INCOMPLETE_CLONES;
     if (name == "nodelete")