From 624ed85a6f723b95b9314a6894c5708a0e45f7ad Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 18 Dec 2008 10:53:34 -0800 Subject: [PATCH] mon: add multiple mds's at once --- src/mds/MDSMap.h | 2 +- src/mon/MDSMonitor.cc | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mds/MDSMap.h b/src/mds/MDSMap.h index 59198c9900b1f..8428c4d77ce99 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 57a50f56c4c4a..ca8be8359a3a6 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++; -- 2.39.5