From bf89bffa462f7107b5f67e025cc9b3a5e390937c Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 4 Apr 2023 22:12:35 -0400 Subject: [PATCH] qa: add test case for mds sending multiple boot messages Test case for [1]. [1] https://tracker.ceph.com/issues/59318 Signed-off-by: Patrick Donnelly (cherry picked from commit f194b277ec56c1c47c5c2b0186c995c96ef265af) --- qa/tasks/cephfs/test_failover.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/qa/tasks/cephfs/test_failover.py b/qa/tasks/cephfs/test_failover.py index bc1657b096849..de9f141da964e 100644 --- a/qa/tasks/cephfs/test_failover.py +++ b/qa/tasks/cephfs/test_failover.py @@ -2,7 +2,7 @@ import time import signal import logging import operator -from random import randint +from random import randint, choice from tasks.cephfs.cephfs_test_case import CephFSTestCase from teuthology.exceptions import CommandFailedError @@ -301,6 +301,27 @@ class TestFailover(CephFSTestCase): CLIENTS_REQUIRED = 1 MDSS_REQUIRED = 2 + def test_repeated_boot(self): + """ + That multiple boot messages do not result in the MDS getting evicted. + """ + + interval = 10 + self.config_set("mon", "paxos_propose_interval", interval) + + mds = choice(list(self.fs.status().get_all())) + + with self.assert_cluster_log(f"daemon mds.{mds['name']} restarted", present=False): + # Avoid a beacon to the monitors with down:dne by restarting: + self.fs.mds_fail(mds_id=mds['name']) + # `ceph mds fail` won't return until the FSMap is committed, double-check: + self.assertIsNone(self.fs.status().get_mds_gid(mds['gid'])) + time.sleep(2) # for mds to restart and accept asok commands + status1 = self.fs.mds_asok(['status'], mds_id=mds['name']) + time.sleep(interval*1.5) + status2 = self.fs.mds_asok(['status'], mds_id=mds['name']) + self.assertEqual(status1['id'], status2['id']) + def test_simple(self): """ That when the active MDS is killed, a standby MDS is promoted into -- 2.39.5