]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: better warning with injectargs on non-up mds
authorSage Weil <sage@newdream.net>
Wed, 1 Jul 2009 18:43:10 +0000 (11:43 -0700)
committerSage Weil <sage@newdream.net>
Wed, 1 Jul 2009 18:43:10 +0000 (11:43 -0700)
src/TODO
src/mon/MDSMonitor.cc

index 6c7c665cfb77c7e4459b8fa6cec1926e4a3dd0ba..f88a568953ae8e2ac8449e747565cd6faea82791 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -170,6 +170,7 @@ journaler
 
 
 mon
+- mds injectargs N should take mds# or id.  * should bcast to standy mds's.
 - paxos need to clean up old states.
   - default: simple max of (state count, min age), so that we have at least N hours of history, say?
   - osd map: trim only old maps < oldest "in" osd up_from
index 22f15d5ffe8a4498c285b45ca5a906d03fbbf2a9..12516e3daf8de82dd84707d32c8855b486f2e965 100644 (file)
@@ -424,11 +424,16 @@ bool MDSMonitor::preprocess_command(MMonCommand *m)
       } else {
        errno = 0;
        int who = strtol(m->cmd[2].c_str(), 0, 10);
-       if (!errno && who >= 0 && mdsmap.is_active(who)) {
-         mon->inject_args(mdsmap.get_inst(who), m->cmd[3], paxos->get_version());
-         r = 0;
-         ss << "ok";
-       } else 
+       if (!errno && who >= 0) {
+         if (mdsmap.is_active(who)) {
+           mon->inject_args(mdsmap.get_inst(who), m->cmd[3], paxos->get_version());
+           r = 0;
+           ss << "ok";
+         } else {
+           ss << "mds" << who << " not up";
+           r = -ENOENT;
+         }
+       } else
          ss << "specify mds number or *";
       }
     }