mirror of
https://github.com/ceph/ceph
synced 2024-12-19 01:46:00 +00:00
Merge PR #54446 into main
* refs/pull/54446/head: qa: bump up scrub status command timeout Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Dhairya Parmar <dparmar@redhat.com>
This commit is contained in:
commit
f155b8fb61
@ -1556,11 +1556,9 @@ class CephManager:
|
||||
self.cephadm = cephadm
|
||||
self.testdir = teuthology.get_testdir(self.ctx)
|
||||
# prefix args for ceph cmds to be executed
|
||||
pre = ['adjust-ulimits', 'ceph-coverage',
|
||||
f'{self.testdir}/archive/coverage']
|
||||
self.CEPH_CMD = ['sudo'] + pre + ['timeout', '120', 'ceph',
|
||||
'--cluster', self.cluster]
|
||||
self.RADOS_CMD = pre + ['rados', '--cluster', self.cluster]
|
||||
self.pre = ['adjust-ulimits', 'ceph-coverage',
|
||||
f'{self.testdir}/archive/coverage']
|
||||
self.RADOS_CMD = self.pre + ['rados', '--cluster', self.cluster]
|
||||
|
||||
pools = self.list_pools()
|
||||
self.pools = {}
|
||||
@ -1571,6 +1569,11 @@ class CephManager:
|
||||
except CommandFailedError:
|
||||
self.log('Failed to get pg_num from pool %s, ignoring' % pool)
|
||||
|
||||
def get_ceph_cmd(self, **kwargs):
|
||||
timeout = kwargs.pop('timeout', 120)
|
||||
return ['sudo'] + self.pre + ['timeout', f'{timeout}', 'ceph',
|
||||
'--cluster', self.cluster]
|
||||
|
||||
def ceph(self, cmd, **kwargs):
|
||||
"""
|
||||
Simple Ceph admin command wrapper around run_cluster_cmd.
|
||||
@ -1614,7 +1617,7 @@ class CephManager:
|
||||
stdout=StringIO(),
|
||||
check_status=kwargs.get('check_status', True))
|
||||
else:
|
||||
kwargs['args'] = prefixcmd + self.CEPH_CMD + kwargs['args']
|
||||
kwargs['args'] = prefixcmd + self.get_ceph_cmd(**kwargs) + kwargs['args']
|
||||
return self.controller.run(**kwargs)
|
||||
|
||||
def raw_cluster_cmd(self, *args, **kwargs) -> str:
|
||||
|
@ -1314,9 +1314,9 @@ class Filesystem(MDSCluster):
|
||||
info = self.get_rank(rank=rank, status=status)
|
||||
return self.json_asok(command, 'mds', info['name'], timeout=timeout)
|
||||
|
||||
def rank_tell(self, command, rank=0, status=None):
|
||||
def rank_tell(self, command, rank=0, status=None, timeout=120):
|
||||
try:
|
||||
out = self.get_ceph_cmd_stdout("tell", f"mds.{self.id}:{rank}", *command)
|
||||
out = self.get_ceph_cmd_stdout("tell", f"mds.{self.id}:{rank}", *command, timeout=timeout)
|
||||
return json.loads(out)
|
||||
except json.decoder.JSONDecodeError:
|
||||
log.error("could not decode: {}".format(out))
|
||||
@ -1731,11 +1731,11 @@ class Filesystem(MDSCluster):
|
||||
self.set_max_mds(new_max_mds)
|
||||
return self.wait_for_daemons()
|
||||
|
||||
def run_scrub(self, cmd, rank=0):
|
||||
return self.rank_tell(["scrub"] + cmd, rank)
|
||||
def run_scrub(self, cmd, rank=0, timeout=300):
|
||||
return self.rank_tell(["scrub"] + cmd, rank=rank, timeout=timeout)
|
||||
|
||||
def get_scrub_status(self, rank=0):
|
||||
return self.run_scrub(["status"], rank)
|
||||
return self.run_scrub(["status"], rank=rank, timeout=300)
|
||||
|
||||
def flush(self, rank=0):
|
||||
return self.rank_tell(["flush", "journal"], rank=rank)
|
||||
@ -1747,7 +1747,7 @@ class Filesystem(MDSCluster):
|
||||
result = "no active scrubs running"
|
||||
with contextutil.safe_while(sleep=sleep, tries=timeout//sleep) as proceed:
|
||||
while proceed():
|
||||
out_json = self.rank_tell(["scrub", "status"], rank=rank)
|
||||
out_json = self.rank_tell(["scrub", "status"], rank=rank, timeout=timeout)
|
||||
assert out_json is not None
|
||||
if not reverse:
|
||||
if result in out_json['status']:
|
||||
|
@ -804,9 +804,11 @@ class LocalCephManager(CephManager):
|
||||
self.cephadm = False
|
||||
self.rook = False
|
||||
self.testdir = None
|
||||
self.CEPH_CMD = [CEPH_CMD]
|
||||
self.RADOS_CMD = [RADOS_CMD]
|
||||
|
||||
def get_ceph_cmd(self, **kwargs):
|
||||
return [CEPH_CMD]
|
||||
|
||||
def find_remote(self, daemon_type, daemon_id):
|
||||
"""
|
||||
daemon_type like 'mds', 'osd'
|
||||
|
Loading…
Reference in New Issue
Block a user