Merge PR #53600 into main

* refs/pull/53600/head:
	mds/FSMap: allow upgrades if no up mds

Reviewed-by: Milind Changire <mchangir@redhat.com>
This commit is contained in:
Patrick Donnelly 2023-10-03 12:30:20 +00:00
commit c743568a93
No known key found for this signature in database
GPG Key ID: C620C0A27CC1274A

View 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);
}
/**