From: chungfengz Date: Wed, 10 Jul 2024 04:07:56 +0000 (+0000) Subject: mon: fix `fs set down` to adjust max_mds only when cluster is not down X-Git-Tag: v20.0.0~1330^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6bfce64f7e97726d27b872077d6b9addab87ab64;p=ceph.git mon: fix `fs set down` to adjust max_mds only when cluster is not down Applying `fs set down false` on an up cluster will set the cluster's max_mds to 1, regardless of the cluster's current max_mds. `fs set down false` should only change max_mds when the cluster was set to down. Otherwise, the cluster should remain unchanged. Fixes: https://tracker.ceph.com/issues/66960 Signed-off-by: chungfengz --- diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index 2660d1bda96..62d37574ded 100644 --- a/src/mon/FSCommands.cc +++ b/src/mon/FSCommands.cc @@ -598,6 +598,11 @@ int FileSystemCommandHandler::set_val(Monitor *mon, FSMap& fsmap, MonOpRequestRe ss << fsp->get_mds_map().get_fs_name(); + if (!is_down && fsp->get_mds_map().get_max_mds() > 0) { + ss << " is already online"; + return 0; + } + modify_filesystem(fsmap, fsv, [is_down](auto&& fs) {