mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
mds: take standby_for_fscid into account in FSMap::find_unused()
Fixes: http://tracker.ceph.com/issues/15402 Signed-off-by: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
parent
ce50389b77
commit
fd2f4555f9
@ -512,7 +512,8 @@ mds_gid_t FSMap::find_standby_for(mds_role_t role, const std::string& name) cons
|
||||
return result;
|
||||
}
|
||||
|
||||
mds_gid_t FSMap::find_unused(bool force_standby_active) const {
|
||||
mds_gid_t FSMap::find_unused(fs_cluster_id_t fscid,
|
||||
bool force_standby_active) const {
|
||||
for (const auto &i : standby_daemons) {
|
||||
const auto &gid = i.first;
|
||||
const auto &info = i.second;
|
||||
@ -521,6 +522,10 @@ mds_gid_t FSMap::find_unused(bool force_standby_active) const {
|
||||
if (info.laggy() || info.rank >= 0)
|
||||
continue;
|
||||
|
||||
if (info.standby_for_fscid != FS_CLUSTER_ID_NONE &&
|
||||
info.standby_for_fscid != fscid)
|
||||
continue;
|
||||
|
||||
if ((info.standby_for_rank == MDSMap::MDS_NO_STANDBY_PREF ||
|
||||
info.standby_for_rank == MDSMap::MDS_MATCHED_ACTIVE ||
|
||||
(info.standby_for_rank == MDSMap::MDS_STANDBY_ANY
|
||||
@ -537,7 +542,7 @@ mds_gid_t FSMap::find_replacement_for(mds_role_t role, const std::string& name,
|
||||
if (standby)
|
||||
return standby;
|
||||
else
|
||||
return find_unused(force_standby_active);
|
||||
return find_unused(role.fscid, force_standby_active);
|
||||
}
|
||||
|
||||
void FSMap::sanity() const
|
||||
|
@ -411,7 +411,7 @@ public:
|
||||
|
||||
mds_gid_t find_standby_for(mds_role_t mds, const std::string& name) const;
|
||||
|
||||
mds_gid_t find_unused(bool force_standby_active) const;
|
||||
mds_gid_t find_unused(fs_cluster_id_t fscid, bool force_standby_active) const;
|
||||
|
||||
mds_gid_t find_replacement_for(mds_role_t mds, const std::string& name,
|
||||
bool force_standby_active) const;
|
||||
|
Loading…
Reference in New Issue
Block a user