]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: wait for MDS to join fsmap
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 2 Mar 2021 23:07:39 +0000 (15:07 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 3 Mar 2021 17:30:21 +0000 (09:30 -0800)
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 <pdonnell@redhat.com>
qa/tasks/ceph.py

index 4d0432f95cd4c25dc97e938057505ada547e0e41..18fb862b5b3dc086202bc2b97e7d3f7c710e295b 100644 (file)
@@ -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)