2018-04-30 21:43:28 +00:00
|
|
|
"""
|
|
|
|
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)
|
2021-03-30 21:55:54 +00:00
|
|
|
fs.getinfo() # load name
|
2021-03-30 21:53:04 +00:00
|
|
|
fs.set_allow_standby_replay(False)
|
2018-04-30 21:43:28 +00:00
|
|
|
fs.set_max_mds(1)
|
2018-05-03 20:12:54 +00:00
|
|
|
fs.reach_max_mds()
|