diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /qa/tasks/mds_pre_upgrade.py | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'qa/tasks/mds_pre_upgrade.py')
-rw-r--r-- | qa/tasks/mds_pre_upgrade.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/qa/tasks/mds_pre_upgrade.py b/qa/tasks/mds_pre_upgrade.py new file mode 100644 index 00000000..0856d483 --- /dev/null +++ b/qa/tasks/mds_pre_upgrade.py @@ -0,0 +1,43 @@ +""" +Prepare MDS cluster for upgrade. +""" + +import logging +import time + +from tasks.cephfs.filesystem import Filesystem + +log = logging.getLogger(__name__) + +def task(ctx, config): + """ + Prepare MDS cluster for upgrade. + + This task reduces ranks to 1 and stops all standbys. + """ + + if config is None: + config = {} + assert isinstance(config, dict), \ + 'snap-upgrade task only accepts a dict for configuration' + + fs = Filesystem(ctx) + status = fs.getinfo() + + fs.set_max_mds(1) + fs.reach_max_mds() + + # Stop standbys now to minimize time rank 0 is down in subsequent: + # tasks: + # - ceph.stop: [mds.*] + rank0 = fs.get_rank(rank=0, status=status) + for daemon in ctx.daemons.iter_daemons_of_role('mds', fs.mon_manager.cluster): + if rank0['name'] != daemon.id_: + daemon.stop() + + for i in range(1, 10): + time.sleep(5) # time for FSMap to update + status = fs.getinfo() + if len(list(status.get_standbys())) == 0: + break + assert(len(list(status.get_standbys())) == 0) |