From: Patrick Donnelly Date: Fri, 22 Sep 2023 18:05:23 +0000 (-0400) Subject: mds/FSMap: allow upgrades if no up mds X-Git-Tag: v19.0.0~354^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F53600%2Fhead;p=ceph.git mds/FSMap: allow upgrades if no up mds 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 --- diff --git a/src/mds/FSMap.h b/src/mds/FSMap.h index 3961c2c8d10..9720eb90d0d 100644 --- a/src/mds/FSMap.h +++ b/src/mds/FSMap.h @@ -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); } /**