]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: handle thrashing ranks with holes
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 20 Jan 2017 21:55:22 +0000 (16:55 -0500)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 6 Feb 2017 19:07:12 +0000 (14:07 -0500)
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 <pdonnell@redhat.com>
qa/tasks/mds_thrash.py

index f1db6ac8db1a7cc0f771dc1784efc9a69c3eb1e7..854505428c8cc3a79a1b1ffcca8e98e6660993ab 100644 (file)
@@ -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]