Merge PR #58582 into main

* refs/pull/58582/head:
	test: add a test for `fs set down` on online cluster
	mon: fix `fs set down` to adjust max_mds only when cluster is not down

Reviewed-by: Dhairya Parmar <dparmar@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
Patrick Donnelly 2024-08-06 17:03:25 -04:00
commit 95dffdcbbd
No known key found for this signature in database
GPG Key ID: FA47FD0B0367D313
2 changed files with 10 additions and 0 deletions

View File

@ -976,6 +976,11 @@ function test_mon_mds()
ceph fs set $FS_NAME cluster_down true
ceph fs set $FS_NAME cluster_down false
ceph fs set $FS_NAME max_mds 2
ceph fs get $FS_NAME | expect_true grep -P -q 'max_mds\t2'
ceph fs set $FS_NAME down false
ceph fs get $FS_NAME | expect_true grep -P -q 'max_mds\t2'
ceph mds compat rm_incompat 4
ceph mds compat rm_incompat 4

View File

@ -598,6 +598,11 @@ int FileSystemCommandHandler::set_val(Monitor *mon, FSMap& fsmap, MonOpRequestRe
ss << fsp->get_mds_map().get_fs_name();
if (!is_down && fsp->get_mds_map().get_max_mds() > 0) {
ss << " is already online";
return 0;
}
modify_filesystem(fsmap, fsv,
[is_down](auto&& fs)
{