]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/osd_types: add READ_LEASE_INTERVAL pool property, osd_pool_readable_min_ratio
authorSage Weil <sage@redhat.com>
Tue, 9 Jul 2019 15:31:54 +0000 (10:31 -0500)
committerSage Weil <sage@redhat.com>
Thu, 26 Sep 2019 17:21:53 +0000 (12:21 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/legacy_config_opts.h
src/common/options.cc
src/osd/PeeringState.h
src/osd/osd_types.cc
src/osd/osd_types.h

index ddbf75b35c26e378927e0c0f3af018aa357e768c..43a24a4201e631fbc4b67625ef2a2ac55fe54b5f 100644 (file)
@@ -578,6 +578,7 @@ OPTION(osd_pool_default_cache_target_full_ratio, OPT_FLOAT)
 OPTION(osd_pool_default_cache_min_flush_age, OPT_INT)  // seconds
 OPTION(osd_pool_default_cache_min_evict_age, OPT_INT)  // seconds
 OPTION(osd_pool_default_cache_max_evict_check_size, OPT_INT)  // max size to check for eviction
+OPTION(osd_pool_default_read_lease_ratio, OPT_FLOAT)
 OPTION(osd_hit_set_min_size, OPT_INT)  // min target size for a HitSet
 OPTION(osd_hit_set_max_size, OPT_INT)  // max target size for a HitSet
 OPTION(osd_hit_set_namespace, OPT_STR) // rados namespace for hit_set tracking
index 0ebbe4b3037cdb016196c7d162974b4bce830255..54c4fe27527b73929b2f9b8b515e7c3faba285d4 100644 (file)
@@ -2630,6 +2630,13 @@ std::vector<Option> get_global_options() {
     .set_enum_allowed({"off", "warn", "on"})
     .set_description("Default PG autoscaling behavior for new pools"),
 
+    Option("osd_pool_default_read_lease_ratio", Option::TYPE_FLOAT, Option::LEVEL_DEV)
+    .set_default(.8)
+    .set_flag(Option::FLAG_RUNTIME)
+    .set_description("Default read_lease_ratio for a pool, as a multiple of osd_heartbeat_grace")
+    .set_long_description("This should be <= 1.0 so that the read lease will have expired by the time we decide to mark a peer OSD down.")
+    .add_see_also("osd_heartbeat_grace"),
+
     Option("osd_hit_set_min_size", Option::TYPE_INT, Option::LEVEL_ADVANCED)
     .set_default(1000)
     .set_description(""),
index 7767cde6f04fb5651fb08870850bdc1a93a2e0be..9a7b8514922d96fc0cf1af1ac69565068567943b 100644 (file)
@@ -47,8 +47,14 @@ struct PGPool {
   void update(CephContext *cct, OSDMapRef map);
 
   ceph::timespan get_readable_interval() const {
-    return ceph::make_timespan(
-      cct->_conf->osd_heartbeat_interval * 2.0);
+    double v = 0;
+    if (info.opts.get(pool_opts_t::READ_LEASE_INTERVAL, &v)) {
+      return ceph::make_timespan(v);
+    } else {
+      auto hbi = cct->_conf->osd_heartbeat_grace;
+      auto fac = cct->_conf->osd_pool_default_read_lease_ratio;
+      return ceph::make_timespan(hbi * fac);
+    }
   }
 };
 
index af432cec3d74a98f674f01cbd3c15859aa6f2de8..a505c6fa81f6921e246e54c00d6af5db9d62cb11 100644 (file)
@@ -1341,7 +1341,9 @@ static opt_mapping_t opt_mapping = boost::assign::map_list_of
            ("target_size_ratio", pool_opts_t::opt_desc_t(
             pool_opts_t::TARGET_SIZE_RATIO, pool_opts_t::DOUBLE))
            ("pg_autoscale_bias", pool_opts_t::opt_desc_t(
-            pool_opts_t::PG_AUTOSCALE_BIAS, pool_opts_t::DOUBLE));
+            pool_opts_t::PG_AUTOSCALE_BIAS, pool_opts_t::DOUBLE))
+           ("read_lease_interval", pool_opts_t::opt_desc_t(
+            pool_opts_t::READ_LEASE_INTERVAL, pool_opts_t::DOUBLE));
 
 bool pool_opts_t::is_opt_name(const std::string& name)
 {
index 3f45d84bc008dfedf2dffb565b8eb27d54d0bf52..78881d5c93984f8d263c78a0ff8ca2723fa05c2c 100644 (file)
@@ -1050,6 +1050,7 @@ public:
     TARGET_SIZE_BYTES,  // total bytes in pool
     TARGET_SIZE_RATIO,  // fraction of total cluster
     PG_AUTOSCALE_BIAS,
+    READ_LEASE_INTERVAL,
   };
 
   enum type_t {