From: Kefu Chai Date: Sat, 2 May 2020 15:54:44 +0000 (+0800) Subject: qa/tasks/ceph.py: do not use option mimic does not understand X-Git-Tag: v14.2.10~83^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0166985f96ecfd3ec8ee529c1882cd9abfa1c895;p=ceph.git qa/tasks/ceph.py: do not use option mimic does not understand mimic does not have `mon-client-directed-command-retry` option, so we should not pass this option to a mimic ceph client. in this change, we fall back to plain retry, if command fails. this change is not cherry-picked from master. as we don't run upgrade test from mimic to master. Signed-off-by: Kefu Chai --- diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index aa4c9620fdc5..219c22c6c745 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -1680,6 +1680,25 @@ def validate_config(ctx, config): last_role = role +def stop_logging_health(remote, cluster, retry): + # try this several times, since tell to mons is lossy. + args = 'sudo ceph --cluster {cluster} {retry_opts} tell mon.* injectargs -- --no-mon-health-to-clog' + try: + retry_opts = '--mon-client-directed-command-retry {}'.format(retry) + remote.run( + args=args.format(cluster=cluster, + retry_opts=retry_opts)) + except run.CommandFailedError: + for i in range(retry): + try: + remote.run( + args=args.format(cluster=cluster, + retry_opts='')) + return + except run.CommandFailedError: + pass + + @contextlib.contextmanager def task(ctx, config): """ @@ -1886,17 +1905,4 @@ def task(ctx, config): # a bunch of scary messages unrelated to our actual run. firstmon = teuthology.get_first_mon(ctx, config, config['cluster']) (mon0_remote,) = ctx.cluster.only(firstmon).remotes.keys() - # try this several times, since tell to mons is lossy. - mon0_remote.run( - args=[ - 'sudo', - 'ceph', - '--cluster', config['cluster'], - '--mon-client-directed-command-retry', '5', - 'tell', - 'mon.*', - 'injectargs', - '--', - '--no-mon-health-to-clog', - ] - ) + stop_logging_health(mon0_remote, config['cluster'], 5)