]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add test case for mds sending multiple boot messages
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 5 Apr 2023 02:12:35 +0000 (22:12 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 28 Jun 2023 15:44:26 +0000 (11:44 -0400)
Test case for [1].

[1] https://tracker.ceph.com/issues/59318

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit f194b277ec56c1c47c5c2b0186c995c96ef265af)

qa/tasks/cephfs/test_failover.py

index 8fb9f2775a935eb5ef97eebf6e703854b2feae30..6149c6bd62614a894107a986d613c7edd43a7832 100644 (file)
@@ -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
@@ -297,6 +297,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