qa: use simpler fs fail to bring fs down

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
Patrick Donnelly 2019-01-15 14:10:09 -08:00
parent 4c49f165ec
commit 6e1d7c4b39
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB
2 changed files with 13 additions and 11 deletions

View File

@ -283,12 +283,6 @@ class MDSCluster(CephCluster):
def status(self):
return FSStatus(self.mon_manager)
def set_down(self, down=True):
self.mon_manager.raw_cluster_cmd("fs", "set", str(self.name), "down", str(down).lower())
def set_joinable(self, joinable=True):
self.mon_manager.raw_cluster_cmd("fs", "set", str(self.name), "joinable", str(joinable).lower())
def delete_all_filesystems(self):
"""
Remove all filesystems that exist, and any pools in use by them.
@ -301,7 +295,7 @@ class MDSCluster(CephCluster):
# mark cluster down for each fs to prevent churn during deletion
status = self.status()
for fs in status.get_filesystems():
self.mon_manager.raw_cluster_cmd("fs", "set", str(fs['mdsmap']['fs_name']), "joinable", "false")
self.mon_manager.raw_cluster_cmd("fs", "fail", str(fs['mdsmap']['fs_name']))
# get a new copy as actives may have since changed
status = self.status()
@ -309,9 +303,6 @@ class MDSCluster(CephCluster):
mdsmap = fs['mdsmap']
metadata_pool = pool_id_name[mdsmap['metadata_pool']]
for gid in mdsmap['up'].values():
self.mon_manager.raw_cluster_cmd('mds', 'fail', gid.__str__())
self.mon_manager.raw_cluster_cmd('fs', 'rm', mdsmap['fs_name'], '--yes-i-really-mean-it')
self.mon_manager.raw_cluster_cmd('osd', 'pool', 'delete',
metadata_pool, metadata_pool,
@ -477,10 +468,19 @@ class Filesystem(MDSCluster):
assert(mds_map['max_mds'] == max_mds)
assert(mds_map['in'] == list(range(0, max_mds)))
def fail(self):
self.mon_manager.raw_cluster_cmd("fs", "fail", str(self.name))
def set_var(self, var, *args):
a = map(str, args)
self.mon_manager.raw_cluster_cmd("fs", "set", self.name, var, *a)
def set_down(self, down=True):
self.set_var("down", str(down).lower())
def set_joinable(self, joinable=True):
self.set_var("joinable", str(joinable).lower())
def set_max_mds(self, max_mds):
self.set_var("max_mds", "%d" % max_mds)

View File

@ -122,7 +122,9 @@ class FailHandler : public FileSystemCommandHandler
for (const auto& gid : to_fail) {
mon->mdsmon()->fail_mds_gid(fsmap, gid);
}
mon->osdmon()->propose_pending();
if (!to_fail.empty()) {
mon->osdmon()->propose_pending();
}
ss << fs_name;
ss << " marked not joinable; MDS cannot join the cluster. All MDS ranks marked failed.";