From: Yan, Zheng Date: Thu, 12 Apr 2018 11:21:48 +0000 (+0800) Subject: mds: show health warning if multimds with old format snapshots X-Git-Tag: v13.1.0~2^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7a227cc09cfb8f55c4541ca5d7c01dd6d6fa6178;p=ceph.git mds: show health warning if multimds with old format snapshots Signed-off-by: "Yan, Zheng" --- diff --git a/src/mds/MDSMap.cc b/src/mds/MDSMap.cc index db3d0561d98a..b9b16d3e02d1 100644 --- a/src/mds/MDSMap.cc +++ b/src/mds/MDSMap.cc @@ -421,6 +421,13 @@ void MDSMap::get_health(list >& summary, << " laggy"; summary.push_back(make_pair(HEALTH_WARN, oss.str())); } + + if (get_max_mds() > 1 && + was_snaps_ever_allowed() && !allows_multimds_snaps()) { + std::ostringstream oss; + oss << "multi-active mds while there are snapshots possibly created by pre-mimic MDS"; + summary.push_back(make_pair(HEALTH_WARN, oss.str())); + } } void MDSMap::get_health_checks(health_check_map_t *checks) const @@ -468,13 +475,13 @@ void MDSMap::get_health_checks(health_check_map_t *checks) const } // MDS_UP_LESS_THAN_MAX - if ((mds_rank_t)get_num_in_mds() < max_mds) { + if ((mds_rank_t)get_num_in_mds() < get_max_mds()) { health_check_t& check = checks->add( "MDS_UP_LESS_THAN_MAX", HEALTH_WARN, "%num% filesystem%plurals% %isorare% online with fewer MDS than max_mds"); stringstream ss; ss << "fs " << fs_name << " has " << get_num_in_mds() - << " MDS online, but wants " << max_mds; + << " MDS online, but wants " << get_max_mds(); check.detail.push_back(ss.str()); } @@ -487,6 +494,16 @@ void MDSMap::get_health_checks(health_check_map_t *checks) const ss << "fs " << fs_name << " is offline because no MDS is active for it."; check.detail.push_back(ss.str()); } + + if (get_max_mds() > 1 && + was_snaps_ever_allowed() && !allows_multimds_snaps()) { + health_check_t &check = checks->add( + "MULTIMDS_WITH_OLDSNAPS", HEALTH_ERR, + "%num% filesystem%plurals% %isorare% multi-active mds with old snapshots"); + stringstream ss; + ss << "multi-active mds while there are snapshots possibly created by pre-mimic MDS"; + check.detail.push_back(ss.str()); + } } void MDSMap::mds_info_t::encode_versioned(bufferlist& bl, uint64_t features) const