parameters: (ctx, config)
docstring: Stress test the mds by running scrub iterations while another task/workunit
      is running.
      Example config:
  
      - fwd_scrub:
        scrub_timeout: 300
        sleep_between_iterations: 1
docstring_summary: Stress test the mds by running scrub iterations while another task/workunit
      is running.
      Example config:
docstring_tokens: Stress test the mds by running scrub iterations while another task / workunit is running . Example config :
function: def task(ctx, config):
      """
      Stress test the mds by running scrub iterations while another task/workunit
      is running.
      Example config:
  
      - fwd_scrub:
        scrub_timeout: 300
        sleep_between_iterations: 1
      """
  
      mds_cluster = MDSCluster(ctx)
  
      if config is None:
          config = {}
      assert isinstance(config, dict), \
          'fwd_scrub task only accepts a dict for configuration'
      mdslist = list(teuthology.all_roles_of_type(ctx.cluster, 'mds'))
      assert len(mdslist) > 0, \
          'fwd_scrub task requires at least 1 metadata server'
  
      (first,) = ctx.cluster.only(f'mds.{mdslist[0]}').remotes.keys()
      manager = ceph_manager.CephManager(
          first, ctx=ctx, logger=log.getChild('ceph_manager'),
      )
  
      # make sure everyone is in active, standby, or standby-replay
      log.info('Wait for all MDSs to reach steady state...')
      status = mds_cluster.status()
      while True:
          steady = True
          for info in status.get_all():
              state = info['state']
              if state not in ('up:active', 'up:standby', 'up:standby-replay'):
                  steady = False
                  break
          if steady:
              break
          sleep(2)
          status = mds_cluster.status()
  
      log.info('Ready to start scrub thrashing')
  
      manager.wait_for_clean()
      assert manager.is_clean()
  
      if 'cluster' not in config:
          config['cluster'] = 'ceph'
  
      for fs in status.get_filesystems():
          fwd_scrubber = ForwardScrubber(Filesystem(ctx, fscid=fs['id']),
                                         config['scrub_timeout'],
                                         config['sleep_between_iterations'])
          fwd_scrubber.start()
          ctx.ceph[config['cluster']].thrashers.append(fwd_scrubber)
  
      try:
          log.debug('Yielding')
          yield
      finally:
          log.info('joining ForwardScrubbers')
          stop_all_fwd_scrubbers(ctx.ceph[config['cluster']].thrashers)
          log.info('done joining')
function_tokens: def task ( ctx , config ) : mds_cluster = MDSCluster ( ctx ) if config is None : config = { } assert isinstance ( config , dict ) , 'fwd_scrub task only accepts a dict for configuration' mdslist = list ( teuthology . all_roles_of_type ( ctx . cluster , 'mds' ) ) assert len ( mdslist ) > 0 , 'fwd_scrub task requires at least 1 metadata server' ( first , ) = ctx . cluster . only ( f'mds.{mdslist[0]}' ) . remotes . keys ( ) manager = ceph_manager . CephManager ( first , ctx = ctx , logger = log . getChild ( 'ceph_manager' ) , ) # make sure everyone is in active, standby, or standby-replay log . info ( 'Wait for all MDSs to reach steady state...' ) status = mds_cluster . status ( ) while True : steady = True for info in status . get_all ( ) : state = info [ 'state' ] if state not in ( 'up:active' , 'up:standby' , 'up:standby-replay' ) : steady = False break if steady : break sleep ( 2 ) status = mds_cluster . status ( ) log . info ( 'Ready to start scrub thrashing' ) manager . wait_for_clean ( ) assert manager . is_clean ( ) if 'cluster' not in config : config [ 'cluster' ] = 'ceph' for fs in status . get_filesystems ( ) : fwd_scrubber = ForwardScrubber ( Filesystem ( ctx , fscid = fs [ 'id' ] ) , config [ 'scrub_timeout' ] , config [ 'sleep_between_iterations' ] ) fwd_scrubber . start ( ) ctx . ceph [ config [ 'cluster' ] ] . thrashers . append ( fwd_scrubber ) try : log . debug ( 'Yielding' ) yield finally : log . info ( 'joining ForwardScrubbers' ) stop_all_fwd_scrubbers ( ctx . ceph [ config [ 'cluster' ] ] . thrashers ) log . info ( 'done joining' )