]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: make 'mds cluster_{up,down}' idempotent
authorSage Weil <sage@inktank.com>
Tue, 16 Jul 2013 23:26:57 +0000 (16:26 -0700)
committerSage Weil <sage@inktank.com>
Tue, 16 Jul 2013 23:26:57 +0000 (16:26 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/MDSMonitor.cc

index 811cdf03b7fffb9a55190eb6deca07fbac7d2aca..172f0f1e3dbeebcd429ef92ac9137a69b61337e8 100644 (file)
@@ -886,23 +886,19 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
   } else if (prefix == "mds cluster_down") {
     if (pending_mdsmap.test_flag(CEPH_MDSMAP_DOWN)) {
       ss << "mdsmap already marked DOWN";
-      r = -EPERM;
     } else {
       pending_mdsmap.set_flag(CEPH_MDSMAP_DOWN);
       ss << "marked mdsmap DOWN";
-      r = 0;
     }
-
+    r = 0;
   } else if (prefix == "mds cluster_up") {
     if (pending_mdsmap.test_flag(CEPH_MDSMAP_DOWN)) {
       pending_mdsmap.clear_flag(CEPH_MDSMAP_DOWN);
       ss << "unmarked mdsmap DOWN";
-      r = 0;
     } else {
       ss << "mdsmap not marked DOWN";
-      r = -EPERM;
     }
-
+    r = 0;
   } else if (prefix == "mds compat rm_compat") {
     int64_t f;
     cmd_getval(g_ceph_context, cmdmap, "feature", f);