summaryrefslogtreecommitdiffstats
path: root/qa/tasks/mds_pre_upgrade.py
blob: 812d402edee454b51ef1855850969d2705b24b04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
Prepare MDS cluster for upgrade.
"""

import logging

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)
    fs.getinfo() # load name
    fs.set_allow_standby_replay(False)
    fs.set_max_mds(1)
    fs.reach_max_mds()