Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nautilus: mon/OSDMonitor: allow pg_num to increase when require_osd_release < N #29671

Merged
merged 3 commits into from
Aug 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7274,14 +7274,26 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap,
return -EPERM;
}
}
// set targets; mgr will adjust pg_num_actual and pgp_num later.
// make pgp_num track pg_num if it already matches. if it is set
// differently, leave it different and let the user control it
// manually.
if (p.get_pg_num_target() == p.get_pgp_num_target()) {
p.set_pgp_num_target(n);
if (osdmap.require_osd_release < CEPH_RELEASE_NAUTILUS) {
// pre-nautilus osdmap format; increase pg_num directly
assert(n > (int)p.get_pg_num());
// force pre-nautilus clients to resend their ops, since they
// don't understand pg_num_target changes form a new interval
p.last_force_op_resend_prenautilus = pending_inc.epoch;
// force pre-luminous clients to resend their ops, since they
// don't understand that split PGs now form a new interval.
p.last_force_op_resend_preluminous = pending_inc.epoch;
p.set_pg_num(n);
} else {
// set targets; mgr will adjust pg_num_actual and pgp_num later.
// make pgp_num track pg_num if it already matches. if it is set
// differently, leave it different and let the user control it
// manually.
if (p.get_pg_num_target() == p.get_pgp_num_target()) {
p.set_pgp_num_target(n);
}
p.set_pg_num_target(n);
}
p.set_pg_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";
Expand Down Expand Up @@ -7322,13 +7334,22 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap,
ss << "specified pgp_num " << n << " > pg_num " << p.get_pg_num_target();
return -EINVAL;
}
p.set_pgp_num_target(n);
if (osdmap.require_osd_release < CEPH_RELEASE_NAUTILUS) {
// pre-nautilus osdmap format; increase pgp_num directly
p.set_pgp_num(n);
} else {
p.set_pgp_num_target(n);
}
} else if (var == "pg_autoscale_mode") {
n = pg_pool_t::get_pg_autoscale_mode_by_name(val);
if (n < 0) {
ss << "specified invalid mode " << val;
return -EINVAL;
}
if (osdmap.require_osd_release < CEPH_RELEASE_NAUTILUS) {
ss << "must set require_osd_release to nautilus or later before setting pg_autoscale_mode";
return -EINVAL;
}
p.pg_autoscale_mode = n;
} else if (var == "crush_rule") {
int id = osdmap.crush->get_rule_id(val);
Expand Down