From: Patrick Donnelly Date: Wed, 6 Jan 2021 19:11:16 +0000 (-0800) Subject: qa: check for rank hole without racy joinable flag gymnastics X-Git-Tag: v16.1.0~66^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1015e935eaa649adb834e66b1742780358cac499;p=ceph.git qa: check for rank hole without racy joinable flag gymnastics Fixes: https://tracker.ceph.com/issues/48770 Signed-off-by: Patrick Donnelly --- diff --git a/qa/tasks/cephfs/test_failover.py b/qa/tasks/cephfs/test_failover.py index 268f19749b75..85dab456737b 100644 --- a/qa/tasks/cephfs/test_failover.py +++ b/qa/tasks/cephfs/test_failover.py @@ -265,26 +265,23 @@ class TestClusterResize(CephFSTestCase): self.fs.grow(2) + # Now add a delay which should slow down how quickly rank 1 stops + self.config_set('mds', 'ms_inject_delay_max', '5.0') + self.config_set('mds', 'ms_inject_delay_probability', '1.0') self.fs.set_max_mds(1) log.info("status = {0}".format(self.fs.status())) - self.fs.set_max_mds(3) # Don't wait for rank 1 to stop + self.fs.set_max_mds(3) + log.info("status = {0}".format(self.fs.status())) + # Now check that the mons didn't try to promote a standby to rank 2 self.fs.set_max_mds(2) - # Prevent another MDS from taking rank 1 - # XXX This is a little racy because rank 1 may have stopped and a - # standby assigned to rank 1 before joinable=0 is set. - self.fs.set_joinable(False) # XXX keep in mind changing max_mds clears this flag - + status = self.fs.status() try: status = self.fs.wait_for_daemons(timeout=90) - raise RuntimeError("should not be able to successfully shrink cluster!") - except: - # could not shrink to max_mds=2 and reach 2 actives (because joinable=False) - status = self.fs.status() ranks = set([info['rank'] for info in status.get_ranks(fscid)]) - self.assertTrue(ranks == set([0])) + self.assertEqual(ranks, set([0, 1])) finally: log.info("status = {0}".format(status))