Skip to content

Commit 95dffdc

Browse files
committed
Merge PR ceph#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 <[email protected]> Reviewed-by: Patrick Donnelly <[email protected]>
2 parents d10ca1a + f8becaa commit 95dffdc

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

qa/workunits/cephtool/test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,11 @@ function test_mon_mds()
976976
ceph fs set $FS_NAME cluster_down true
977977
ceph fs set $FS_NAME cluster_down false
978978

979+
ceph fs set $FS_NAME max_mds 2
980+
ceph fs get $FS_NAME | expect_true grep -P -q 'max_mds\t2'
981+
ceph fs set $FS_NAME down false
982+
ceph fs get $FS_NAME | expect_true grep -P -q 'max_mds\t2'
983+
979984
ceph mds compat rm_incompat 4
980985
ceph mds compat rm_incompat 4
981986

src/mon/FSCommands.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,11 @@ int FileSystemCommandHandler::set_val(Monitor *mon, FSMap& fsmap, MonOpRequestRe
598598

599599
ss << fsp->get_mds_map().get_fs_name();
600600

601+
if (!is_down && fsp->get_mds_map().get_max_mds() > 0) {
602+
ss << " is already online";
603+
return 0;
604+
}
605+
601606
modify_filesystem(fsmap, fsv,
602607
[is_down](auto&& fs)
603608
{

0 commit comments

Comments
 (0)