OPTION(mon_client_hunt_interval_backoff, OPT_DOUBLE) // each time we reconnect to a monitor, double our timeout
OPTION(mon_client_hunt_interval_max_multiple, OPT_DOUBLE) // up to a max of 10*default (30 seconds)
OPTION(mon_client_max_log_entries_per_message, OPT_INT)
-OPTION(mon_max_pool_pg_num, OPT_INT)
OPTION(mon_pool_quota_warn_threshold, OPT_INT) // percent of quota at which to issue warnings
OPTION(mon_pool_quota_crit_threshold, OPT_INT) // percent of quota at which to issue errors
OPTION(client_cache_size, OPT_INT)
OPTION(osd_crush_update_on_start, OPT_BOOL)
OPTION(osd_class_update_on_start, OPT_BOOL) // automatically set device class on start
OPTION(osd_crush_initial_weight, OPT_DOUBLE) // if >=0, the initial weight is for newly added osds.
-OPTION(osd_pool_erasure_code_stripe_unit, OPT_U32) // in bytes
OPTION(osd_erasure_code_plugins, OPT_STR) // list of erasure code plugins
// Allows the "peered" state for recovery and backfill below min_size
OPTION(osd_tier_promote_max_objects_sec, OPT_U64)
OPTION(osd_tier_promote_max_bytes_sec, OPT_U64)
-OPTION(osd_tier_default_cache_mode, OPT_STR)
-OPTION(osd_tier_default_cache_hit_set_count, OPT_INT)
-OPTION(osd_tier_default_cache_hit_set_period, OPT_INT)
-OPTION(osd_tier_default_cache_hit_set_type, OPT_STR)
-OPTION(osd_tier_default_cache_min_read_recency_for_promote, OPT_INT) // number of recent HitSets the object must appear in to be promoted (on read)
-OPTION(osd_tier_default_cache_min_write_recency_for_promote, OPT_INT) // number of recent HitSets the object must appear in to be promoted (on write)
-OPTION(osd_tier_default_cache_hit_set_grade_decay_rate, OPT_INT)
-OPTION(osd_tier_default_cache_hit_set_search_last_n, OPT_INT)
OPTION(osd_objecter_finishers, OPT_INT)
OPTION(osd_map_dedup, OPT_BOOL)
.set_default(1000)
.set_description(""),
- Option("mon_max_pool_pg_num", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("mon_max_pool_pg_num", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(65536)
.set_description(""),
Option("osd_pool_erasure_code_stripe_unit", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(4_K)
- .set_description(""),
+ .set_description("the amount of data (in bytes) in a data chunk, per stripe")
+ .add_service("mon"),
Option("osd_pool_default_size", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(3)
Option("osd_pool_default_type", Option::TYPE_STR, Option::LEVEL_ADVANCED)
.set_default("replicated")
.set_enum_allowed({"replicated", "erasure"})
- .set_description(""),
+ .set_description("")
+ .add_service("mon"),
Option("osd_pool_default_erasure_code_profile", Option::TYPE_STR, Option::LEVEL_ADVANCED)
.set_default("plugin=jerasure technique=reed_sol_van k=2 m=1")
Option("osd_pool_default_hit_set_bloom_fpp", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
.set_default(.05)
- .set_description(""),
+ .set_description("")
+ .add_see_also("osd_tier_default_cache_hit_set_type"),
Option("osd_pool_default_cache_target_dirty_ratio", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
.set_default(.4)
Option("osd_tier_default_cache_mode", Option::TYPE_STR, Option::LEVEL_ADVANCED)
.set_default("writeback")
+ .set_enum_allowed({"none", "writeback", "forward",
+ "readonly", "readforward", "readproxy", "proxy"})
.set_description(""),
- Option("osd_tier_default_cache_hit_set_count", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("osd_tier_default_cache_hit_set_count", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(4)
.set_description(""),
- Option("osd_tier_default_cache_hit_set_period", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("osd_tier_default_cache_hit_set_period", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(1200)
.set_description(""),
Option("osd_tier_default_cache_hit_set_type", Option::TYPE_STR, Option::LEVEL_ADVANCED)
.set_default("bloom")
+ .set_enum_allowed({"bloom", "explicit_hash", "explicit_object"})
.set_description(""),
- Option("osd_tier_default_cache_min_read_recency_for_promote", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("osd_tier_default_cache_min_read_recency_for_promote", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(1)
- .set_description(""),
+ .set_description("number of recent HitSets the object must appear in to be promoted (on read)"),
- Option("osd_tier_default_cache_min_write_recency_for_promote", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("osd_tier_default_cache_min_write_recency_for_promote", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(1)
- .set_description(""),
+ .set_description("number of recent HitSets the object must appear in to be promoted (on write)"),
- Option("osd_tier_default_cache_hit_set_grade_decay_rate", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("osd_tier_default_cache_hit_set_grade_decay_rate", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(20)
.set_description(""),
- Option("osd_tier_default_cache_hit_set_search_last_n", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("osd_tier_default_cache_hit_set_search_last_n", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(1)
.set_description(""),
if (err)
break;
uint32_t data_chunks = erasure_code->get_data_chunk_count();
- uint32_t stripe_unit = g_conf->osd_pool_erasure_code_stripe_unit;
+ uint32_t stripe_unit = g_conf->get_val<uint64_t>("osd_pool_erasure_code_stripe_unit");
auto it = profile.find("stripe_unit");
if (it != profile.end()) {
string err_str;
pg_num = g_conf->get_val<uint64_t>("osd_pool_default_pg_num");
if (pgp_num == 0)
pgp_num = g_conf->get_val<uint64_t>("osd_pool_default_pgp_num");
- if (pg_num > (unsigned)g_conf->mon_max_pool_pg_num) {
+ if (pg_num > g_conf->get_val<uint64_t>("mon_max_pool_pg_num")) {
*ss << "'pg_num' must be greater than 0 and less than or equal to "
- << g_conf->mon_max_pool_pg_num
+ << g_conf->get_val<uint64_t>("mon_max_pool_pg_num")
<< " (you may adjust 'mon max pool pg num' for higher values)";
return -ERANGE;
}
return -EEXIST;
return 0;
}
- if (n > (unsigned)g_conf->mon_max_pool_pg_num) {
+ if (static_cast<uint64_t>(n) > g_conf->get_val<uint64_t>("mon_max_pool_pg_num")) {
ss << "'pg_num' must be greater than 0 and less than or equal to "
- << g_conf->mon_max_pool_pg_num
+ << g_conf->get_val<uint64_t>("mon_max_pool_pg_num")
<< " (you may adjust 'mon max pool pg num' for higher values)";
return -ERANGE;
}
return err;
if (val == "bloom") {
BloomHitSet::Params *bsp = new BloomHitSet::Params;
- bsp->set_fpp(g_conf->osd_pool_default_hit_set_bloom_fpp);
+ bsp->set_fpp(g_conf->get_val<double>("osd_pool_default_hit_set_bloom_fpp"));
p.hit_set_params = HitSet::Params(bsp);
} else if (val == "explicit_hash")
p.hit_set_params = HitSet::Params(new ExplicitHashHitSet::Params);
err = -ENOTEMPTY;
goto reply;
}
- string modestr = g_conf->osd_tier_default_cache_mode;
+ auto& modestr = g_conf->get_val<string>("osd_tier_default_cache_mode");
pg_pool_t::cache_mode_t mode = pg_pool_t::get_cache_mode_from_str(modestr);
if (mode < 0) {
ss << "osd tier cache default mode '" << modestr << "' is not a valid cache mode";
goto reply;
}
HitSet::Params hsp;
- if (g_conf->osd_tier_default_cache_hit_set_type == "bloom") {
+ auto& cache_hit_set_type =
+ g_conf->get_val<string>("osd_tier_default_cache_hit_set_type");
+ if (cache_hit_set_type == "bloom") {
BloomHitSet::Params *bsp = new BloomHitSet::Params;
- bsp->set_fpp(g_conf->osd_pool_default_hit_set_bloom_fpp);
+ bsp->set_fpp(g_conf->get_val<double>("osd_pool_default_hit_set_bloom_fpp"));
hsp = HitSet::Params(bsp);
- } else if (g_conf->osd_tier_default_cache_hit_set_type == "explicit_hash") {
+ } else if (cache_hit_set_type == "explicit_hash") {
hsp = HitSet::Params(new ExplicitHashHitSet::Params);
- }
- else if (g_conf->osd_tier_default_cache_hit_set_type == "explicit_object") {
+ } else if (cache_hit_set_type == "explicit_object") {
hsp = HitSet::Params(new ExplicitObjectHitSet::Params);
} else {
- ss << "osd tier cache default hit set type '" <<
- g_conf->osd_tier_default_cache_hit_set_type << "' is not a known type";
+ ss << "osd tier cache default hit set type '"
+ << cache_hit_set_type << "' is not a known type";
err = -EINVAL;
goto reply;
}
ntp->set_last_force_op_resend(pending_inc.epoch);
ntp->tier_of = pool_id;
ntp->cache_mode = mode;
- ntp->hit_set_count = g_conf->osd_tier_default_cache_hit_set_count;
- ntp->hit_set_period = g_conf->osd_tier_default_cache_hit_set_period;
- ntp->min_read_recency_for_promote = g_conf->osd_tier_default_cache_min_read_recency_for_promote;
- ntp->min_write_recency_for_promote = g_conf->osd_tier_default_cache_min_write_recency_for_promote;
- ntp->hit_set_grade_decay_rate = g_conf->osd_tier_default_cache_hit_set_grade_decay_rate;
- ntp->hit_set_search_last_n = g_conf->osd_tier_default_cache_hit_set_search_last_n;
+ ntp->hit_set_count = g_conf->get_val<uint64_t>("osd_tier_default_cache_hit_set_count");
+ ntp->hit_set_period = g_conf->get_val<uint64_t>("osd_tier_default_cache_hit_set_period");
+ ntp->min_read_recency_for_promote = g_conf->get_val<uint64_t>("osd_tier_default_cache_min_read_recency_for_promote");
+ ntp->min_write_recency_for_promote = g_conf->get_val<uint64_t>("osd_tier_default_cache_min_write_recency_for_promote");
+ ntp->hit_set_grade_decay_rate = g_conf->get_val<uint64_t>("osd_tier_default_cache_hit_set_grade_decay_rate");
+ ntp->hit_set_search_last_n = g_conf->get_val<uint64_t>("osd_tier_default_cache_hit_set_search_last_n");
ntp->hit_set_params = hsp;
ntp->target_max_bytes = size;
ss << "pool '" << tierpoolstr << "' is now (or already was) a cache tier of '" << poolstr << "'";
profile["layers"] = description_string;
EXPECT_EQ(0, lrc.init(profile, &cerr));
EXPECT_EQ(4U, lrc.get_data_chunk_count());
- unsigned int chunk_size = g_conf->osd_pool_erasure_code_stripe_unit;
+ unsigned int chunk_size = g_conf->get_val<uint64_t>("osd_pool_erasure_code_stripe_unit");
unsigned int stripe_width = lrc.get_data_chunk_count() * chunk_size;
EXPECT_EQ(chunk_size, lrc.get_chunk_size(stripe_width));
set<int> want_to_encode;
profile["layers"] = description_string;
EXPECT_EQ(0, lrc.init(profile, &cerr));
EXPECT_EQ(4U, lrc.get_data_chunk_count());
- unsigned int chunk_size = g_conf->osd_pool_erasure_code_stripe_unit;
+ unsigned int chunk_size = g_conf->get_val<uint64_t>("osd_pool_erasure_code_stripe_unit");
unsigned int stripe_width = lrc.get_data_chunk_count() * chunk_size;
EXPECT_EQ(chunk_size, lrc.get_chunk_size(stripe_width));
set<int> want_to_encode;