]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/OSDMonitor: introduce osd_pool_default_type config option
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 3 Jul 2017 06:14:21 +0000 (14:14 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 4 Jul 2017 10:22:09 +0000 (18:22 +0800)
In luminous we now have full support of ec pool, so it is not
good to continue hardcoding default pool type to "replicated".

Introduce a configurable osd_pool_default_type for this.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/common/config_opts.h
src/mon/OSDMonitor.cc
src/osd/osd_types.h

index 1c94cd0f1b18120a470193c1d166afae500eec6f..a98fcb38f48d0927dd8e4ccfe383c0299271a305 100644 (file)
@@ -696,6 +696,7 @@ OPTION(osd_pool_default_size, OPT_INT, 3)
 OPTION(osd_pool_default_min_size, OPT_INT, 0)  // 0 means no specific default; ceph will use size-size/2
 OPTION(osd_pool_default_pg_num, OPT_INT, 8) // number of PGs for new pools. Configure in global or mon section of ceph.conf
 OPTION(osd_pool_default_pgp_num, OPT_INT, 8) // number of PGs for placement purposes. Should be equal to pg_num
+OPTION(osd_pool_default_type, OPT_STR, "replicated")
 OPTION(osd_pool_default_erasure_code_profile,
        OPT_STR,
        "plugin=jerasure "
index 405c05a8ee06a5bbe8b6eb8d66c2c2d42921ea09..69dc7d43ba0cf35d444a859d1620bd6479d57918 100644 (file)
@@ -9509,7 +9509,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     string pool_type_str;
     cmd_getval(g_ceph_context, cmdmap, "pool_type", pool_type_str);
     if (pool_type_str.empty())
-      pool_type_str = pg_pool_t::get_default_type();
+      pool_type_str = g_conf->osd_pool_default_type;
 
     string poolstr;
     cmd_getval(g_ceph_context, cmdmap, "pool", poolstr);
index 182a01bdb3133f5687410c3add3f765b2f530027..0b4d665cce3153eaf0c2b99a35f85b4820cfead7 100644 (file)
@@ -1115,9 +1115,6 @@ struct pg_pool_t {
   const char *get_type_name() const {
     return get_type_name(type);
   }
-  static const char* get_default_type() {
-    return "replicated";
-  }
 
   enum {
     FLAG_HASHPSPOOL = 1<<0, // hash pg seed and pool together (instead of adding)