]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/FSMap: allow upgrades if no up mds 53600/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 22 Sep 2023 18:05:23 +0000 (14:05 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 2 Oct 2023 17:55:38 +0000 (17:55 +0000)
This is to support the fail_fs scenario for cephadm where max_mds >= 1
and all MDS are down.

Fixes: https://tracker.ceph.com/issues/62682
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/FSMap.h

index 3961c2c8d10b87e574c0051030965eb74dc2e6b6..9720eb90d0d27d854d6509933031c409cee59f27 100644 (file)
@@ -198,8 +198,16 @@ public:
   void print(std::ostream& out) const;
 
   bool is_upgradeable() const {
-    return (mds_map.allows_standby_replay() && mds_map.get_num_in_mds() == 0)
-       || (!mds_map.allows_standby_replay() && mds_map.get_num_in_mds() <= 1);
+    bool asr = mds_map.allows_standby_replay();
+    auto in_mds = mds_map.get_num_in_mds();
+    auto up_mds = mds_map.get_num_up_mds();
+    return
+              /* fs was "down" */
+              (in_mds == 0)
+              /* max_mds was set to 1; asr must be disabled */
+           || (!asr && in_mds == 1)
+              /* max_mds any value and all MDS were failed; asr must be disabled */
+           || (!asr && up_mds == 0);
   }
 
   /**