Confirmation flag must be passed when running the command "ceph fs fail"
when the MDS for this FS has either of the two health warnings: MDS_TRIM
or MDS_CACHE_OVERSIZED. Else, the command will fail and print an
appropriate error message.
Restarting an MDS with these health warnings is not recommened since it
will have a slow recovery during restart which will create new problems.
Fixes: https://tracker.ceph.com/issues/61866
Signed-off-by: Rishabh Dave <ridave@redhat.com>
return -ENOENT;
}
+ bool confirm = false;
+ cmd_getval(cmdmap, "yes_i_really_mean_it", confirm);
+ if (!confirm &&
+ mon->mdsmon()->has_health_warnings({
+ MDS_HEALTH_TRIM, MDS_HEALTH_CACHE_OVERSIZED})) {
+ ss << errmsg_for_unhealthy_mds;
+ return -EPERM;
+ }
+
auto f = [](auto&& fs) {
fs.get_mds_map().set_flag(CEPH_MDSMAP_NOT_JOINABLE);
};
"make new filesystem using named pools <metadata> and <data>",
"fs", "rw")
COMMAND("fs fail "
- "name=fs_name,type=CephString ",
+ "name=fs_name,type=CephString "
+ "name=yes_i_really_mean_it,type=CephBool,req=false",
"bring the file system down and all of its ranks",
"fs", "rw")
COMMAND("fs rm "