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: v17.2.7~21^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4a0e7734d7761ffb31b57d64f28c288b36ff75e0;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 (cherry picked from commit 7cde5724e6b47631acd037a2ebd96ea72ad07324) --- diff --git a/src/mds/FSMap.h b/src/mds/FSMap.h index 5bf2f6b267f1..f57a4177aa04 100644 --- a/src/mds/FSMap.h +++ b/src/mds/FSMap.h @@ -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); } /**