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
.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(""),
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);
+ }
}
};
("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)
{
TARGET_SIZE_BYTES, // total bytes in pool
TARGET_SIZE_RATIO, // fraction of total cluster
PG_AUTOSCALE_BIAS,
+ READ_LEASE_INTERVAL,
};
enum type_t {