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.
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()
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.