]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: refuse to stop mds if max_mds will make it rejoin
authorSage Weil <sage@newdream.net>
Thu, 23 Feb 2012 20:08:52 +0000 (12:08 -0800)
committerSage Weil <sage@newdream.net>
Thu, 23 Feb 2012 20:08:52 +0000 (12:08 -0800)
Otherwise the MDS will leave the cluster and immediately rejoin, which is
useless and confusing to users.  See #1820.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/MDSMonitor.cc

index 96a69fca45119d644c733841814b407562476e95..385ce1c6d1880629bfaa0441f1316876221583dd 100644 (file)
@@ -728,6 +728,9 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
        r = -EBUSY;
        ss << "can't tell the root (" << mdsmap.get_root() << ") or tableserver (" << mdsmap.get_tableserver()
           << " to stop unless it is the last mds in the cluster";
+      } else if (mdsmap.get_num_in_mds() <= mdsmap.get_max_mds()) {
+       r = -EBUSY;
+       ss << "must decrease max_mds or else MDS will rejoin after shutdown";
       } else {
        r = 0;
        uint64_t gid = pending_mdsmap.up[who];