]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: throttle scrub start for multiple active MDS
authorMilind Changire <mchangir@redhat.com>
Fri, 10 Jan 2020 06:31:34 +0000 (12:01 +0530)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 5 Feb 2020 01:52:09 +0000 (17:52 -0800)
* add check to "scrub start" command handler to dishonor request if
  multiple MDS are "active" for a recursive scrub request
* add check to MDSRank::handle_mds_map() to see if scrubbing is in
  progress and max_mds is greater than 1, if so then scrubbing is
  aborted. This is supposed to take care of the condition when scrubbing
  has been started with max_mds == 1 and then bumped to a higher value

Fixes: https://tracker.ceph.com/issues/43483
Signed-off-by: Milind Changire <mchangir@redhat.com>
(cherry picked from commit f50b87bcb4737befcccf6310aaf522200361e731)

Conflicts:
src/mds/MDSRank.cc
src/mds/ScrubStack.h

src/mds/MDSRank.cc
src/mds/ScrubStack.h

index c448f84f427559f3eb4c4b9c5d6448a4f9ea35d5..e99a11233e6217a6f8c4befcb7c3319059911668 100644 (file)
@@ -2401,6 +2401,12 @@ void MDSRankDispatcher::handle_mds_map(
     purge_queue.update_op_limit(*mdsmap);
   }
 
+  if (scrubstack->is_scrubbing()) {
+    if (mdsmap->get_max_mds() > 1) {
+      auto c = new C_MDSInternalNoop;
+      scrubstack->scrub_abort(c);
+    }
+  }
   mdcache->handle_mdsmap(*mdsmap);
 }
 
@@ -2516,6 +2522,12 @@ bool MDSRankDispatcher::handle_asok_command(std::string_view command,
     cmd_getval(g_ceph_context, cmdmap, "scrubops", scrubop_vec);
     cmd_getval(g_ceph_context, cmdmap, "path", path);
 
+    /* Multiple MDS scrub is not currently supported. See also: https://tracker.ceph.com/issues/12274 */
+    if (mdsmap->get_max_mds() > 1) {
+      ss << "Scrub is not currently supported for multiple active MDS. Please reduce max_mds to 1 and then scrub.";
+      return true;
+    }
+
     C_SaferCond cond;
     command_scrub_start(f, path, "", scrubop_vec, &cond);
     cond.wait();
index de51ed3fd94e4b678128e1dea210dd56276c729e..fb3ececd437ccfc6143846c954c39657cd8fa69b 100644 (file)
@@ -126,6 +126,8 @@ public:
    */
   void scrub_status(Formatter *f);
 
+  bool is_scrubbing() const { return !inode_stack.empty(); }
+
 private:
   // scrub abort is _not_ a state, rather it's an operation that's
   // performed after in-progress scrubs are finished.