]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: add a config option to enable (by default) recovery below min_size
authorSamuel Just <sjust@redhat.com>
Tue, 17 Feb 2015 18:06:19 +0000 (10:06 -0800)
committerSamuel Just <sjust@redhat.com>
Wed, 18 Feb 2015 23:09:56 +0000 (15:09 -0800)
This may be useful at some point.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/common/config_opts.h
src/osd/PG.cc

index 7994e3e8fb4d158934501b69398ac4949c7d3c83..5bc8c80668e02683eb495bb7bbd41312c07cb66b 100644 (file)
@@ -505,6 +505,10 @@ OPTION(osd_erasure_code_plugins, OPT_STR,
        " isa"
 #endif
        ) // list of erasure code plugins
+
+// Allows the "peered" state for recovery and backfill below min_size
+OPTION(osd_allow_recovery_below_min_size, OPT_BOOL, true)
+
 OPTION(osd_pool_default_flags, OPT_INT, 0)   // default flags for new pools
 OPTION(osd_pool_default_flag_hashpspool, OPT_BOOL, true)   // use new pg hashing to prevent pool/pg overlap
 OPTION(osd_pool_default_flag_nodelete, OPT_BOOL, false) // pool can't be deleted
index 8c55007b6aa8ce610b05e6b01c0411cbbe9b09db..b2f46f6a32551a75453f5c8d10ad547e061c727b 100644 (file)
@@ -1312,7 +1312,8 @@ bool PG::choose_acting(pg_shard_t &auth_log_shard_id)
   // Otherwise, we will go "peered", but not "active"
   if (num_want_acting < pool.info.min_size &&
       (pool.info.ec_pool() ||
-       !(get_min_peer_features() & CEPH_FEATURE_OSD_MIN_SIZE_RECOVERY))) {
+       (!(get_min_peer_features() & CEPH_FEATURE_OSD_MIN_SIZE_RECOVERY)) ||
+       !cct->_conf->osd_allow_recovery_below_min_size)) {
     want_acting.clear();
     dout(10) << "choose_acting failed, below min size" << dendl;
     return false;