From cd643c3abd7b2d37fd60a20662ed7588a397a641 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 15 Jan 2019 13:45:14 -0800 Subject: [PATCH] MDSMonitor: add missing OSDMonitor writeable check Fixes: http://tracker.ceph.com/issues/37929 Signed-off-by: Patrick Donnelly (cherry picked from commit 8ef68663d311f71d1598297c14fad39274ada41d) --- src/mon/FSCommands.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index fcfb85cfc354d..4d4aa3c1fed1f 100644 --- a/src/mon/FSCommands.cc +++ b/src/mon/FSCommands.cc @@ -674,6 +674,13 @@ class RemoveFilesystemHandler : public FileSystemCommandHandler const cmdmap_t& cmdmap, std::stringstream &ss) override { + /* We may need to blacklist ranks. */ + if (!mon->osdmon()->is_writeable()) { + // not allowed to write yet, so retry when we can + mon->osdmon()->wait_for_writeable(op, new PaxosService::C_RetryMessage(mon->mdsmon(), op)); + return -EAGAIN; + } + // Check caller has correctly named the FS to delete // (redundant while there is only one FS, but command // syntax should apply to multi-FS future) @@ -717,6 +724,9 @@ class RemoveFilesystemHandler : public FileSystemCommandHandler // wait for an osdmap propose here: ignore return value. mon->mdsmon()->fail_mds_gid(fsmap, gid); } + if (!to_fail.empty()) { + mon->osdmon()->propose_pending(); /* maybe new blacklists */ + } fsmap.erase_filesystem(fs->fscid); -- 2.39.5