]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix `fs set down` to adjust max_mds only when cluster is not down
authorchungfengz <chungfengz@synology.com>
Wed, 10 Jul 2024 04:07:56 +0000 (04:07 +0000)
committerVenky Shankar <vshankar@redhat.com>
Tue, 10 Sep 2024 11:55:34 +0000 (17:25 +0530)
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 <chungfengz@synology.com>
(cherry picked from commit 6bfce64f7e97726d27b872077d6b9addab87ab64)

 Conflicts:
src/mon/FSCommands.cc

Minor conflict in src/mon/FSCommands.cc related to modify_filesystem()
helper.

src/mon/FSCommands.cc

index 2449df5d1e003fafdd90793674d1e12a01f35f47..e9774230997b530f60ee55d86ee8b50f57c9a366 100644 (file)
@@ -540,6 +540,11 @@ public:
 
       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;
+      }
+
       fsmap.modify_filesystem(
           fsp->get_fscid(),
           [is_down](auto&& fs)