mirror of
https://github.com/ceph/ceph
synced 2025-01-03 01:22:53 +00:00
qa: remove obsolete deactivate routines
This is handled automatically since Mimic. Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
parent
af54ba2d8b
commit
285e1547de
@ -8,7 +8,6 @@ import datetime
|
||||
import re
|
||||
import errno
|
||||
import random
|
||||
import traceback
|
||||
|
||||
from io import BytesIO, StringIO
|
||||
from errno import EBUSY
|
||||
@ -540,41 +539,10 @@ class Filesystem(MDSCluster):
|
||||
raise RuntimeError("cannot specify fscid when configuring overlay")
|
||||
self.metadata_overlay = overlay
|
||||
|
||||
def deactivate(self, rank):
|
||||
if rank < 0:
|
||||
raise RuntimeError("invalid rank")
|
||||
elif rank == 0:
|
||||
raise RuntimeError("cannot deactivate rank 0")
|
||||
self.mon_manager.raw_cluster_cmd("mds", "deactivate", "%d:%d" % (self.id, rank))
|
||||
|
||||
def reach_max_mds(self):
|
||||
# Try to reach rank count == max_mds, up or down (UPGRADE SENSITIVE!)
|
||||
status = self.getinfo()
|
||||
status = self.wait_for_daemons()
|
||||
mds_map = self.get_mds_map(status=status)
|
||||
max_mds = mds_map['max_mds']
|
||||
|
||||
count = len(list(self.get_ranks(status=status)))
|
||||
if count > max_mds:
|
||||
try:
|
||||
# deactivate mds in decending order
|
||||
status = self.wait_for_daemons(status=status, skip_max_mds_check=True)
|
||||
while count > max_mds:
|
||||
targets = sorted(self.get_ranks(status=status), key=lambda r: r['rank'], reverse=True)
|
||||
target = targets[0]
|
||||
log.debug("deactivating rank %d" % target['rank'])
|
||||
self.deactivate(target['rank'])
|
||||
status = self.wait_for_daemons(skip_max_mds_check=True)
|
||||
count = len(list(self.get_ranks(status=status)))
|
||||
except:
|
||||
# In Mimic, deactivation is done automatically:
|
||||
log.info("Error:\n{}".format(traceback.format_exc()))
|
||||
status = self.wait_for_daemons()
|
||||
else:
|
||||
status = self.wait_for_daemons()
|
||||
|
||||
mds_map = self.get_mds_map(status=status)
|
||||
assert(mds_map['max_mds'] == max_mds)
|
||||
assert(mds_map['in'] == list(range(0, max_mds)))
|
||||
assert(mds_map['in'] == list(range(0, mds_map['max_mds'])))
|
||||
|
||||
def reset(self):
|
||||
self.mon_manager.raw_cluster_cmd("fs", "reset", str(self.name), '--yes-i-really-mean-it')
|
||||
|
Loading…
Reference in New Issue
Block a user