all_roles = [item for remote_roles in mdss.remotes.values() for item in remote_roles]
num_active = len([r for r in all_roles if is_active_mds(r)])
- fs.set_allow_multimds(True)
fs.set_max_mds(num_active)
fs.set_allow_dirfrags(True)
def set_allow_dirfrags(self, yes):
self.mon_manager.raw_cluster_cmd("fs", "set", self.name, "allow_dirfrags", str(yes).lower(), '--yes-i-really-mean-it')
- def set_allow_multimds(self, yes):
- self.mon_manager.raw_cluster_cmd("fs", "set", self.name, "allow_multimds", str(yes).lower(), '--yes-i-really-mean-it')
-
def get_pgs_per_fs_pool(self):
"""
Calculate how many PGs to use when creating a pool, in order to avoid raising any
raise RuntimeError("rank {0} failed to reach desired subtree state", rank)
def test_export_pin(self):
- self.fs.set_allow_multimds(True)
self.fs.set_max_mds(2)
status = self.fs.status()
# Create FS alpha and get mds_a to come up as active
fs_a = self.mds_cluster.newfs("alpha")
- fs_a.set_allow_multimds(True)
fs_a.set_max_mds(2)
self.mds_cluster.mds_restart(mds_a)
def test_grow_shrink(self):
# Usual setup...
fs_a, fs_b = self._setup_two()
- fs_a.set_allow_multimds(True)
- fs_b.set_allow_multimds(True)
# Increase max_mds on fs_b, see a standby take up the role
fs_b.set_max_mds(2)
# Create two filesystems which should have two ranks each
fs_a = self.mds_cluster.newfs("alpha")
- fs_a.set_allow_multimds(True)
fs_b = self.mds_cluster.newfs("bravo")
- fs_b.set_allow_multimds(True)
fs_a.set_max_mds(2)
fs_b.set_max_mds(2)
"""
# Set max_mds to 2
- self.fs.set_allow_multimds(True)
self.fs.set_max_mds(2)
# See that we have two active MDSs
class TestMantle(CephFSTestCase):
def start_mantle(self):
self.wait_for_health_clear(timeout=30)
- self.fs.set_allow_multimds(True)
self.fs.set_max_mds(2)
self.wait_until_equal(lambda: len(self.fs.get_active_names()), 2, 30,
reject_fn=lambda v: v > 2 or v < 1)
self.fs.wait_for_daemons()
# I would like two MDSs, so that I can do an export dir later
- self.fs.set_allow_multimds(True)
self.fs.set_max_mds(2)
self.fs.wait_for_daemons()
def _setup_two_ranks(self):
# Set up two MDSs
- self.fs.set_allow_multimds(True)
self.fs.set_max_mds(2)
# See that we have two active MDSs