]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
MDSMonitor: add missing OSDMonitor writeable check 26065/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 15 Jan 2019 21:45:14 +0000 (13:45 -0800)
committerPrashant D <pdhange@redhat.com>
Tue, 22 Jan 2019 01:26:33 +0000 (20:26 -0500)
Fixes: http://tracker.ceph.com/issues/37929
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 8ef68663d311f71d1598297c14fad39274ada41d)

src/mon/FSCommands.cc

index cb3e54711b87d42fd250a6e4ee65da5a3594becd..51c5876013d80381e5944a5753ad9393d95ce57d 100644 (file)
@@ -620,6 +620,13 @@ class RemoveFilesystemHandler : public FileSystemCommandHandler
       map<string, cmd_vartype> &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)
@@ -663,6 +670,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);