mirror of
https://github.com/ceph/ceph
synced 2024-12-26 21:43:10 +00:00
Merge PR #21536 into master
* refs/pull/21536/head: qa: check old_max_mds is not wiped by marked down twice MDSMonitor: do not wipe old_max_mds when marked down twice Reviewed-by: Douglas Fuller <dfuller@redhat.com>
This commit is contained in:
commit
613d3b72cf
@ -88,18 +88,32 @@ class TestClusterResize(CephFSTestCase):
|
||||
self.shrink(2)
|
||||
self.wait_for_health_clear(30)
|
||||
|
||||
def test_down_twice(self):
|
||||
"""
|
||||
That marking a FS down twice does not wipe old_max_mds.
|
||||
"""
|
||||
|
||||
self.grow(2)
|
||||
self.fs.set_down()
|
||||
self.wait_for_health("MDS_ALL_DOWN", 30)
|
||||
self.fs.set_down(False)
|
||||
mdsmap = self.fs.get_mds_map()
|
||||
self.assertTrue(mdsmap["max_mds"] == 2)
|
||||
self.fs.wait_for_daemons(timeout=60)
|
||||
|
||||
def test_all_down(self):
|
||||
"""
|
||||
That a health error is generated when FS has no active MDS.
|
||||
That a health error is generated when FS has no active MDS and cleared
|
||||
when actives come back online.
|
||||
"""
|
||||
|
||||
self.fs.set_down()
|
||||
self.wait_for_health("MDS_ALL_DOWN", 30)
|
||||
self.fs.set_down(False)
|
||||
self.wait_for_health_clear(30)
|
||||
self.fs.set_down()
|
||||
self.fs.set_down(True)
|
||||
self.wait_for_health("MDS_ALL_DOWN", 30)
|
||||
self.grow(1)
|
||||
self.grow(2)
|
||||
self.wait_for_health_clear(30)
|
||||
|
||||
def test_hole(self):
|
||||
|
@ -389,8 +389,10 @@ public:
|
||||
[is_down](std::shared_ptr<Filesystem> fs)
|
||||
{
|
||||
if (is_down) {
|
||||
fs->mds_map.set_old_max_mds();
|
||||
fs->mds_map.set_max_mds(0);
|
||||
if (fs->mds_map.get_max_mds() > 0) {
|
||||
fs->mds_map.set_old_max_mds();
|
||||
fs->mds_map.set_max_mds(0);
|
||||
} /* else already down! */
|
||||
} else {
|
||||
mds_rank_t oldmax = fs->mds_map.get_old_max_mds();
|
||||
fs->mds_map.set_max_mds(oldmax ? oldmax : 1);
|
||||
|
Loading…
Reference in New Issue
Block a user