mirror of
https://github.com/ceph/ceph
synced 2025-01-03 01:22:53 +00:00
mon/MDSMonitor: make legacy 'newfs' command idempotent
We need to return success if we get a dup command. Simply check whether the fs is already enabled with the same pools and name. Fixes: #8857 Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
bf252c8df9
commit
5f6b11a6ad
@ -955,6 +955,16 @@ bool MDSMonitor::management_command(
|
||||
return true;
|
||||
}
|
||||
|
||||
// be idempotent.. success if it already exists and matches
|
||||
if (mdsmap.get_enabled() &&
|
||||
mdsmap.get_metadata_pool() == metadata &&
|
||||
mdsmap.get_first_data_pool() == data &&
|
||||
mdsmap.fs_name == MDS_FS_NAME_DEFAULT) {
|
||||
ss << "filesystem '" << MDS_FS_NAME_DEFAULT << "' already exists";
|
||||
r = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
string sure;
|
||||
cmd_getval(g_ceph_context, cmdmap, "sure", sure);
|
||||
if (pending_mdsmap.get_enabled() && sure != "--yes-i-really-mean-it") {
|
||||
|
Loading…
Reference in New Issue
Block a user