]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add test for standby-replay marking rank damaged 43200/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 9 Sep 2021 23:47:04 +0000 (19:47 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 17 Sep 2021 01:53:56 +0000 (21:53 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit f4a11a329020d31a3f99a5099201676d3e1fb2b9)

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 e66185c42753f47d24577a95403753d0c36ea39e..881ce7d8097984be6f74aa982351a431474f7662 100644 (file)
@@ -148,6 +148,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.
@@ -1045,6 +1052,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 304d27c2c8cff731e7b2bf006d268c9477a6ae31..f2032b23741086e331a7ad1e0be3f99e40fce9d4 100644 (file)
@@ -518,6 +518,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.