If the user asks to reduce pg_num, reduce pg_num_target too at the same
time.
Don't completely hide pgp_num yet (by increasing it when pg_num_target
increases).
Signed-off-by: Sage Weil <sage@redhat.com>
ss << "nautilus OSDs are required to adjust pg_num_pending";
return -EPERM;
}
- if (n < (int)p.get_pgp_num_target()) {
- ss << "specified pg_num " << n
- << " < pgp_num " << p.get_pgp_num_target();
- return -EINVAL;
- }
}
// set target; mgr will adjust pg_num_actual later
p.set_pg_num_target(n);
+ // adjust pgp_num_target down too (as needed)
+ if (p.get_pgp_num_target() > n) {
+ p.set_pgp_num_target(n);
+ }
} else if (var == "pgp_num_actual") {
if (p.has_flag(pg_pool_t::FLAG_NOPGCHANGE)) {
ss << "pool pgp_num change is disabled; you must unset nopgchange flag for the pool first";