Starts a new pool with 1 pg if the autoscale mode is `on`.
If user didn't explicitly specify autoscale mode to be `on`,
we look at the default_autoscale_mode value that is set globally,
if that is `on` then we also start new pool with 1 pg. Else,
just use the default pg value.
Updated `common/options/global.yaml.in` to document the change.
Fixes: https://tracker.ceph.com/issues/49364
Signed-off-by: Kamoltat <ksirivad@redhat.com>
desc: number of PGs for new pools
fmt_desc: The default number of placement groups for a pool. The default
value is the same as ``pg_num`` with ``mkpool``.
+ long_desc: With default value of `osd_pool_default_pg_autoscale_mode` being
+ `on` the number of PGs for new pools will start out with 1 pg, unless the
+ user specifies the pg_num.
default: 32
services:
- mon
+ see_also:
+ - osd_pool_default_pg_autoscale_mode
flags:
- runtime
- name: osd_pool_default_pgp_num
type: str
level: advanced
desc: Default PG autoscaling behavior for new pools
+ long_desc: With default value `on`, the autoscaler starts a new pool with 1
+ pg, unless the user specifies the pg_num.
default: 'on'
enum_values:
- 'off'
{
if (name.length() == 0)
return -EINVAL;
- if (pg_num == 0)
- pg_num = g_conf().get_val<uint64_t>("osd_pool_default_pg_num");
+ if (pg_num == 0) {
+ auto pg_num_from_mode =
+ [pg_num=g_conf().get_val<uint64_t>("osd_pool_default_pg_num")]
+ (const string& mode) {
+ return mode == "on" ? 1 : pg_num;
+ };
+ pg_num = pg_num_from_mode(
+ pg_autoscale_mode.empty() ?
+ g_conf().get_val<string>("osd_pool_default_pg_autoscale_mode") :
+ pg_autoscale_mode);
+ }
if (pgp_num == 0)
pgp_num = g_conf().get_val<uint64_t>("osd_pool_default_pgp_num");
if (!pgp_num)