summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2012-11-20 12:16:44 -0800
committerSamuel Just <sam.just@inktank.com>2012-12-06 22:53:06 -0800
commit338f3688b0dbe6b0c15a4fddbd1538011c9c801b (patch)
tree80ccd8cd9756ffedefa33239fdf37f69e663c447
parentfb738506f6b6a0596a1ed41d1aa273aaa8cd5813 (diff)
downloadceph-338f3688b0dbe6b0c15a4fddbd1538011c9c801b.tar.gz
OSDMonitor: require --allow-experimental-feature to increase pg_num
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/mon/OSDMonitor.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index b2805849af1..7ddbf64bb65 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -2696,7 +2696,7 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
return true;
}
} else if (m->cmd[2] == "set") {
- if (m->cmd.size() != 6) {
+ if (m->cmd.size() < 6) {
err = -EINVAL;
ss << "usage: osd pool set <poolname> <field> <value>";
goto out;
@@ -2740,7 +2740,12 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs, paxos->get_version()));
return true;
} else if (m->cmd[4] == "pg_num") {
- if (n <= p->get_pg_num()) {
+ if (m->cmd.size() < 6 ||
+ m->cmd[6] != "--allow-experimental-feature") {
+ ss << "increasing pg_num is currently experimental, add "
+ << "--allow-experimental-feature as the last argument "
+ << "to force";
+ } else if (n <= p->get_pg_num()) {
ss << "specified pg_num " << n << " <= current " << p->get_pg_num();
} else if (!mon->pgmon()->pg_map.creating_pgs.empty()) {
ss << "currently creating pgs, wait";