]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: command to disable localized pgs for a pool
authorSage Weil <sage@newdream.net>
Wed, 11 Apr 2012 22:32:06 +0000 (15:32 -0700)
committerSage Weil <sage@newdream.net>
Wed, 11 Apr 2012 22:39:06 +0000 (15:39 -0700)
ceph osd pool disable_lpgs <poolname> --yes-i-really-mean-it

Grr, these should be off by default.  We can't adjust them down.  And
currently any pool adjustment triggers pg creation, which will create these
guys up through max_osd (but not, mind you, when max_osd changes).  And
a bug in the OSDs makes them think that creation is a split and get
confused.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/OSDMonitor.cc

index f41ae8d4b3c390e936431b605931d8f1763d27ae..be6470df5bf2ab7186988f7e135e75f904a6099e 100644 (file)
@@ -2016,6 +2016,26 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
          paxos->wait_for_commit(new Monitor::C_Command(mon, m, ret, rs, paxos->get_version()));
          return true;
        }
+      } else if (m->cmd.size() >= 5 &&
+                m->cmd[2] == "disable_lpgs" &&
+                m->cmd[4] == "--yes-i-really-mean-it") {
+       // semi-kludge to disable localized pgs for a pool
+       int64_t pool = osdmap.lookup_pg_pool_name(m->cmd[3].c_str());
+       if (pool < 0) {
+         ss << "unrecognized pool '" << m->cmd[3] << "'";
+         err = -ENOENT;
+       } else {
+         const pg_pool_t *p = osdmap.get_pg_pool(pool);
+         if (pending_inc.new_pools.count(pool) == 0)
+           pending_inc.new_pools[pool] = *p;
+         pending_inc.new_pools[pool].lpg_num = 0;
+         pending_inc.new_pools[pool].lpgp_num = 0;
+         pending_inc.new_pools[pool].last_change = pending_inc.epoch;
+         ss << "disabled localized pgs for pool " << pool;
+         getline(ss, rs);
+         paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs, paxos->get_version()));
+         return true;
+       }
       } else if (m->cmd[2] == "set") {
        if (m->cmd.size() != 6) {
          err = -EINVAL;