]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add multiple mds's at once
authorSage Weil <sage@newdream.net>
Thu, 18 Dec 2008 18:53:34 +0000 (10:53 -0800)
committerSage Weil <sage@newdream.net>
Tue, 23 Dec 2008 19:45:21 +0000 (11:45 -0800)
src/mds/MDSMap.h
src/mon/MDSMonitor.cc

index 59198c9900b1f68d17f3400d288d6b033a95201b..8428c4d77ce991cf5d76f79133f76d97c1588a42 100644 (file)
@@ -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; }
index 57a50f56c4c4afd934974a77ac14e38fb823f44c..ca8be8359a3a67875bb80576b82bfb8aa6ecd766 100644 (file)
@@ -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; i<mdsmap.get_max_mds(); i++)
+       for (unsigned i=0; i<mdsmap.get_max_mds(); i++)
          if (mdsmap.is_active(i))
            mon->inject_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++;