From 911b9a55bbbde0f0b2e5ac5e8fe525d29d9a10dc Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 2 Mar 2021 15:07:39 -0800 Subject: [PATCH] qa: wait for MDS to join fsmap When running under valgrind, MDS may be slow to be added to the FSMap (especially if mons are in valgrind too). The file system creation that follows will throw unnecessary warnings about insufficient standbys if no MDS is available. Signed-off-by: Patrick Donnelly --- qa/tasks/ceph.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 4d0432f95cd4c..18fb862b5b3dc 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -23,7 +23,7 @@ import yaml from paramiko import SSHException from tasks.ceph_manager import CephManager, write_conf, get_valgrind_args from tarfile import ReadError -from tasks.cephfs.filesystem import Filesystem +from tasks.cephfs.filesystem import MDSCluster, Filesystem from teuthology import misc as teuthology from teuthology import contextutil from teuthology import exceptions @@ -417,6 +417,14 @@ def cephfs_setup(ctx, config): fs_configs = cephfs_config.pop('fs', [{'name': 'cephfs'}]) set_allow_multifs = len(fs_configs) > 1 + # wait for standbys to become available (slow due to valgrind, perhaps) + mdsc = MDSCluster(ctx) + mds_count = len(list(teuthology.all_roles_of_type(ctx.cluster, 'mds'))) + with contextutil.safe_while(sleep=2,tries=150) as proceed: + while proceed(): + if len(mdsc.get_standby_daemons()) >= mds_count: + break + fss = [] for fs_config in fs_configs: assert isinstance(fs_config, dict) -- 2.39.5