We need to avoid making drastic changes to pg_num that outpace pgp_num or
else we will may hit the per-osd pg limits.
Fixes: https://tracker.ceph.com/issues/53442
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit
3b2a11249aff6ee608efc95212d6723df180cd07)
Conflicts:
src/common/options/mgr.yaml.in - old way of specifying config settings
OPTION(mon_osd_blocklist_default_expire, OPT_DOUBLE) // default one hour
OPTION(mon_osd_crush_smoke_test, OPT_BOOL)
+OPTION(mgr_max_pg_num_change, OPT_INT)
+
OPTION(paxos_stash_full_interval, OPT_INT) // how often (in commits) to stash a full copy of the PaxosService state
OPTION(paxos_max_join_drift, OPT_INT) // max paxos iterations before we must first sync the monitor stores
OPTION(paxos_propose_interval, OPT_DOUBLE) // gather updates for this long before proposing a map update
.add_service("mgr")
.set_description("Path to cephadm utility"),
+ Option("mgr_max_pg_num_change", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ .set_default(128)
+ .add_service("mgr")
+ .set_description("maximum change in pg_num"),
+
Option("mgr_module_path", Option::TYPE_STR, Option::LEVEL_ADVANCED)
.set_default(CEPH_DATADIR "/mgr")
.add_service("mgr")
} else {
active = false;
}
+ unsigned pg_gap = p.get_pg_num() - p.get_pgp_num();
+ unsigned max_jump = cct->_conf->mgr_max_pg_num_change;
if (!active) {
dout(10) << "pool " << i.first
<< " pg_num_target " << p.get_pg_num_target()
<< " pg_num " << p.get_pg_num()
<< " - not all pgs active"
<< dendl;
+ } else if (pg_gap >= max_jump) {
+ dout(10) << "pool " << i.first
+ << " pg_num " << p.get_pg_num()
+ << " - pgp_num " << p.get_pgp_num()
+ << " gap > max_pg_num_change " << max_jump
+ << " - must scale pgp_num first"
+ << dendl;
} else {
unsigned add = std::min(
- left,
+ std::min(left, max_jump - pg_gap),
p.get_pg_num_target() - p.get_pg_num());
unsigned target = p.get_pg_num() + add;
left -= add;