]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
MDSMonitor: add missing OSDMonitor writeable check 26069/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 02:29:03 +0000 (21:29 -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 fcfb85cfc354d1847d82297a34f8f89b43a5d9e0..4d4aa3c1fed1fb9afc67bae03f11deae92161a77 100644 (file)
@@ -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);