]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
MDSMonitor: add missing OSDMonitor writeable check 25974/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 15 Jan 2019 21:45:14 +0000 (13:45 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 15 Jan 2019 22:26:22 +0000 (14:26 -0800)
Fixes: http://tracker.ceph.com/issues/37929
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mon/FSCommands.cc

index f1fe9eab8ae6f4ddaf00668f6d3fea89102c4341..f106acf5f28226f1e5250356c5790eff8fd26a22 100644 (file)
@@ -677,6 +677,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)
@@ -720,6 +727,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);