From 21c43133c2c042f8e10a18c3865da4405fd16789 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 23 Feb 2012 12:08:52 -0800 Subject: [PATCH] mon: refuse to stop mds if max_mds will make it rejoin Otherwise the MDS will leave the cluster and immediately rejoin, which is useless and confusing to users. See #1820. Signed-off-by: Sage Weil --- src/mon/MDSMonitor.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 96a69fca4511..385ce1c6d188 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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]; -- 2.47.3