]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/FSMap: allow upgrades if no up mds 53852/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 22 Sep 2023 18:05:23 +0000 (14:05 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 5 Oct 2023 20:43:20 +0000 (16:43 -0400)
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>
(cherry picked from commit 7cde5724e6b47631acd037a2ebd96ea72ad07324)

src/mds/FSMap.h

index 5bf2f6b267f1d2ab75c5aa2c478f4fc1a4013461..f57a4177aa04f7a0fd3c78a1bb4dda3dd536dca9 100644 (file)
@@ -205,8 +205,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);
   }
 
   /**