From: Sage Weil Date: Thu, 18 Dec 2008 18:53:34 +0000 (-0800) Subject: mon: add multiple mds's at once X-Git-Tag: v0.6~1^2~228 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=624ed85a6f723b95b9314a6894c5708a0e45f7ad;p=ceph.git mon: add multiple mds's at once --- diff --git a/src/mds/MDSMap.h b/src/mds/MDSMap.h index 59198c9900b..8428c4d77ce 100644 --- a/src/mds/MDSMap.h +++ b/src/mds/MDSMap.h @@ -189,7 +189,7 @@ class MDSMap { epoch_t get_last_failure() const { return last_failure; } - int get_max_mds() const { return max_mds; } + unsigned get_max_mds() const { return max_mds; } void set_max_mds(int m) { max_mds = m; } int get_tableserver() const { return tableserver; } diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 57a50f56c4c..ca8be8359a3 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -383,7 +383,7 @@ bool MDSMonitor::preprocess_command(MMonCommand *m) } else if (m->cmd[1] == "injectargs" && m->cmd.size() == 4) { if (m->cmd[2] == "*") { - for (int i=0; iinject_args(mdsmap.get_inst(i), m->cmd[3]); r = 0; @@ -502,9 +502,8 @@ void MDSMonitor::tick() if (!mon->is_leader()) return; // expand mds cluster (add new nodes to @in)? - int cursize = pending_mdsmap.get_num_mds(); - if (cursize < pending_mdsmap.get_max_mds() && - !pending_mdsmap.is_degraded()) { + while (pending_mdsmap.get_num_mds() < pending_mdsmap.get_max_mds() && + !pending_mdsmap.is_degraded()) { int mds = 0; while (pending_mdsmap.is_in(mds)) mds++;