]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Merge PR #60397 into wip-jcollin-testing-20251009.130945-reef wip-jcollin-testing-20251009.130945-reef testing/wip-jcollin-testing-20251009.130945-reef
authorJos Collin <jcollin@redhat.com>
Thu, 9 Oct 2025 13:10:06 +0000 (18:40 +0530)
committerJos Collin <jcollin@redhat.com>
Thu, 9 Oct 2025 13:10:06 +0000 (18:40 +0530)
* refs/pull/60397/head:
PendingReleaseNotes: add a release note about confirm flag for max_mds
doc/cephfs: update about changing max_mds FS setting variable
qa/cephfs: add tests for confirmationn required to change max_mds
mon,cephfs: require confirmation when changing max_mds on unhealthy cluster

1  2 
PendingReleaseNotes
qa/tasks/cephfs/test_admin.py

Simple merge
index 795fc9df99fd2182a645feb887098ab3524977fa,e0323a30204edf1e7d7174cdbc3aa9c1921427f9..d00129d27de8f3d962b3163fafa0b2cb46ed6780
@@@ -2273,27 -2144,86 +2273,84 @@@ class TestMDSFail(TestAdminCommands)
          '''
          health_warn = 'MDS_CACHE_OVERSIZED'
          self.fs.set_max_mds(2)
 -        self.gen_health_warn_mds_cache_oversized()
 -        mds1_id, mds2_id = self.fs.get_active_names()
 +
 +        self.mount_a.run_shell_payload("mkdir dir1")
 +        self.mount_a.setfattr("dir1", "ceph.dir.pin", "0")
 +        self._wait_subtrees([('/dir1', 0)], rank=0)
 +
 +        mds0_id, mds1_id = self.fs.get_active_names()
 +        self.gen_health_warn_mds_cache_oversized(mds_id=mds0_id, path="dir1")
  
          # MDS ID for which health warning has been generated.
 -        hw_mds_id = self._get_unhealthy_mds_id(health_warn)
 -        if mds1_id == hw_mds_id:
 -            non_hw_mds_id = mds2_id
 -        elif mds2_id == hw_mds_id:
 -            non_hw_mds_id = mds1_id
 -        else:
 -            raise RuntimeError('There are only 2 MDSs right now but apparently'
 -                               'health warning was raised for an MDS other '
 -                               'than these two. This is definitely an error.')
 +        count, hw_mds_id = self._get_unhealthy_mds_id(health_warn)
 +        # Validate the warning is raised on only one mds
 +        self.assertEqual(count, 1)
 +        self.assertEqual(hw_mds_id, mds0_id)
  
          # actual testing begins now...
 -        self.negtest_ceph_cmd(args=f'mds fail {non_hw_mds_id}', retval=1,
 -                              errmsgs=health_warn)
 -        self.negtest_ceph_cmd(args=f'mds fail {hw_mds_id}', retval=1,
 +        self.negtest_ceph_cmd(args=f'mds fail {mds0_id}', retval=1,
                                errmsgs=health_warn)
 -        self.run_ceph_cmd(f'mds fail {mds1_id} --yes-i-really-mean-it')
 -        self.run_ceph_cmd(f'mds fail {mds2_id} --yes-i-really-mean-it')
 +        self.run_ceph_cmd(f'mds fail {mds1_id}')
 +        self.run_ceph_cmd(f'mds fail {mds0_id} --yes-i-really-mean-it')
  
  
+ class TestFSSetMaxMDS(TestAdminCommands):
+     def test_when_unhealthy_without_confirm(self):
+         '''
+         Test that command "ceph fs set <fsname> max_mds <num>" without the
+         confirmation flag (--yes-i-really-mean-it) fails when cluster is
+         unhealthy.
+         '''
+         self.gen_health_warn_mds_cache_oversized()
+         with self.assertRaises(CommandFailedError) as cfe:
+             self.fs.set_max_mds(2, confirm=False)
+         self.assertEqual(cfe.exception.exitstatus, errno.EPERM)
+     def test_when_unhealthy_with_confirm(self):
+         '''
+         Test that command "ceph fs set <fsname> max_mds <num>
+         --yes-i-really-mean-it" runs successfully when cluster is unhealthy.
+         '''
+         self.gen_health_warn_mds_cache_oversized()
+         self.fs.set_max_mds(2, confirm=True)
+         self.assertEqual(self.fs.get_var('max_mds'), 2)
+     def test_when_mds_trim_without_confirm(self):
+         '''
+         Test that command "ceph fs set <fsname> max_mds <num>" without the
+         confirmation flag (--yes-i-really-mean-it) fails when cluster has
+         MDS_TRIM health warning.
+         '''
+         self.gen_health_warn_mds_trim()
+         with self.assertRaises(CommandFailedError) as cfe:
+             self.fs.set_max_mds(2, confirm=False)
+         self.assertEqual(cfe.exception.exitstatus, errno.EPERM)
+     def test_when_mds_trim_when_with_confirm(self):
+         '''
+         Test that command "ceph fs set <fsname> max_mds <num>
+         --yes-i-really-mean-it" runs successfully when cluster has MDS_TRIM
+         health warning.
+         '''
+         self.gen_health_warn_mds_trim()
+         self.fs.set_max_mds(2, confirm=True)
+         self.assertEqual(self.fs.get_var('max_mds'), 2)
+     def test_when_healthy_with_confirm(self):
+         '''
+         Test that command "ceph fs set <fsname> max_mds <num>
+         --yes-i-really-mean-it" runs successfully also when cluster is
+         healthy.
+         '''
+         self.fs.set_max_mds(2, confirm=True)
+         self.assertEqual(self.fs.get_var('max_mds'), 2)
  class TestToggleVolumes(CephFSTestCase):
      '''
      Contains code for enabling/disabling mgr/volumes plugin.