From: Patrick Donnelly Date: Fri, 20 Jan 2017 21:55:22 +0000 (-0500) Subject: qa: handle thrashing ranks with holes X-Git-Tag: v12.0.1~155^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=19289725c8cf8a6836526508b2d55dad8de38c83;p=ceph.git qa: handle thrashing ranks with holes During the course of thrashing max_mds, the ranks assigned to MDSs may develop holes. This causes the thrasher to try to wrongly deactivate ranks that are not assigned. Signed-off-by: Patrick Donnelly --- diff --git a/qa/tasks/mds_thrash.py b/qa/tasks/mds_thrash.py index f1db6ac8db1a..854505428c8c 100644 --- a/qa/tasks/mds_thrash.py +++ b/qa/tasks/mds_thrash.py @@ -228,8 +228,9 @@ class MDSThrasher(Greenlet): stats['max_mds'] += 1 # Now randomly deactivate mds if we shrank - for rank in random.sample(range(1, max_mds), max(0, max_mds-new_max_mds)): - self.fs.deactivate(rank) + targets = filter(lambda r: r['rank'] > 0, status.get_ranks(self.fs.id)) # can't deactivate 0 + for target in random.sample(targets, max(0, max_mds-new_max_mds)): + self.fs.deactivate(target['rank']) stats['deactivate'] += 1 status = self.wait_for_stable()[0]