import json
import math
from teuthology import misc as teuthology
+from tasks.cephfs.filesystem import MDSCluster
log = logging.getLogger(__name__)
in % (default: 0)
freeze_mon_duration: how many seconds to freeze the mon (default: 15)
scrub Scrub after each iteration (default: True)
+ check_mds_failover Check if mds failover happened (default: False)
Note: if 'store-thrash' is set to True, then 'maintain-quorum' must also
be set to True.
seed: 31337
maintain_quorum: true
thrash_many: true
+ check_mds_failover: True
- ceph-fuse:
- workunit:
clients:
assert self.maintain_quorum, \
'store_thrash = true must imply maintain_quorum = true'
+ #MDS failover
+ self.mds_failover = self.config.get('check_mds_failover', False)
+
+ if self.mds_failover:
+ self.mds_cluster = MDSCluster(ctx)
+
self.thread = gevent.spawn(self.do_thrash)
def log(self, x):
"""
Continuously loop and thrash the monitors.
"""
+ #status before mon thrashing
+ if self.mds_failover:
+ oldstatus = self.mds_cluster.status()
+
self.log('start thrashing')
self.log('seed: {s}, revive delay: {r}, thrash delay: {t} '\
'thrash many: {tm}, maintain quorum: {mq} '\
delay=self.thrash_delay))
time.sleep(self.thrash_delay)
+ #status after thrashing
+ if self.mds_failover:
+ status = self.mds_cluster.status()
+ assert not oldstatus.hadfailover(status), \
+ 'MDS Failover'
+
+
@contextlib.contextmanager
def task(ctx, config):
"""