From: Sage Weil Date: Thu, 17 Jul 2014 00:24:36 +0000 (-0700) Subject: mon/MDSMonitor: make legacy 'newfs' command idempotent X-Git-Tag: v0.84~96^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2113%2Fhead;p=ceph.git 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 --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 689f70a07d50..34b9632338ed 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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") {