If it's 0, use the pg_num value. This lets you adjust the
osd_pool_default_pg_num option without also adjusting the pgp_num one.
Signed-off-by: Sage Weil <sage@redhat.com>
.add_service("mon"),
Option("osd_pool_default_pgp_num", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
- .set_default(8)
- .set_description("number of PGs for placement purposes. Should be equal to pg_num")
+ .set_default(0)
+ .set_description("number of PGs for placement purposes (0 to match pg_num)")
.add_see_also("osd_pool_default_pg_num")
.set_flag(Option::FLAG_RUNTIME)
.add_service("mon"),
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 (!pgp_num)
+ pgp_num = 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().get_val<uint64_t>("mon_max_pool_pg_num")