]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add test for standby-replay marking rank damaged 43122/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 9 Sep 2021 23:47:04 +0000 (19:47 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 10 Sep 2021 00:16:03 +0000 (20:16 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
qa/suites/fs/multifs/tasks/failover.yaml
qa/tasks/cephfs/filesystem.py
qa/tasks/cephfs/test_failover.py

index 4a95f01da9c73f02629d54b8493c8cdf506f5262..9c403c76db6c8b48f49e8977bbd7f52285b72c10 100644 (file)
@@ -5,6 +5,8 @@ overrides:
       - \(MDS_INSUFFICIENT_STANDBY\)
       - \(MDS_ALL_DOWN\)
       - \(MDS_UP_LESS_THAN_MAX\)
+      - \(MDS_DAMAGE\)
+      - \(FS_DEGRADED\)
   ceph-fuse:
     disabled: true
 tasks:
index c5076a28bc85d1cdb551dad73a5baf2140a59e52..0f846cf1e0e632834b3c5b479fd5066365c8d2df 100644 (file)
@@ -147,6 +147,13 @@ class FSStatus(object):
             if info['rank'] >= 0 and info['state'] != 'up:standby-replay':
                 yield info
 
+    def get_damaged(self, fscid):
+        """
+        Get the damaged ranks for the given FSCID.
+        """
+        fs = self.get_fsmap(fscid)
+        return fs['mdsmap']['damaged']
+
     def get_rank(self, fscid, rank):
         """
         Get the rank for the given FSCID.
@@ -1013,6 +1020,11 @@ class Filesystem(MDSCluster):
             status = self.getinfo()
         return status.get_ranks(self.id)
 
+    def get_damaged(self, status=None):
+        if status is None:
+            status = self.getinfo()
+        return status.get_damaged(self.id)
+
     def get_replays(self, status=None):
         if status is None:
             status = self.getinfo()
index 3df44d3da33530aabfdf82557289fd97b8834605..5cc8ec0d5899150d0da356b6e3271b49401b079d 100644 (file)
@@ -514,6 +514,22 @@ class TestStandbyReplay(CephFSTestCase):
         time.sleep(30)
         self._confirm_single_replay()
 
+    def test_standby_replay_damaged(self):
+        """
+        That a standby-replay daemon can cause the rank to go damaged correctly.
+        """
+
+        self._confirm_no_replay()
+        self.config_set("mds", "mds_standby_replay_damaged", True)
+        self.fs.set_allow_standby_replay(True)
+        self.wait_until_true(
+            lambda: len(self.fs.get_damaged()) > 0,
+            timeout=30
+        )
+        status = self.fs.status()
+        self.assertListEqual([], list(self.fs.get_ranks(status=status)))
+        self.assertListEqual([0], self.fs.get_damaged(status=status))
+
     def test_standby_replay_disable(self):
         """
         That turning off allow_standby_replay fails all standby-replay daemons.