]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: wait for purgequeue on rank shutdown
authorJohn Spray <john.spray@redhat.com>
Fri, 23 Dec 2016 19:23:20 +0000 (19:23 +0000)
committerJohn Spray <john.spray@redhat.com>
Wed, 8 Mar 2017 10:20:59 +0000 (10:20 +0000)
Also, move shutdown_pass call from dispatch
to tick, so that it doesn't rely on incoming
messages to make progress.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDSRank.cc

index 04269ef039b91d8ca2457e410b6bf98f54355edd..62ae2764a2a1f7329f8fa0839c257f8f12b3d617 100644 (file)
@@ -222,6 +222,28 @@ void MDSRankDispatcher::tick()
       snapserver->check_osd_map(false);
   }
 
+  // shut down?
+  if (is_stopping()) {
+    mdlog->trim();
+    if (mdcache->shutdown_pass()) {
+      if (!purge_queue.is_idle()) {
+        dout(7) << "shutdown_pass=true, but still waiting for purge queue"
+                << dendl;
+        // This takes unbounded time, so we must indicate progress
+        // to the administrator
+        // TODO include progress in message
+        clog->info() << "MDS rank " << whoami << " waiting for purge queue";
+      } else {
+        dout(7) << "shutdown_pass=true, finished w/ shutdown, moving to "
+                   "down:stopped" << dendl;
+        stopping_done();
+      }
+    }
+    else {
+      dout(7) << "shutdown_pass=false" << dendl;
+    }
+  }
+
   // Expose ourselves to Beacon to update health indicators
   beacon.notify_health(this);
 }
@@ -571,17 +593,6 @@ bool MDSRank::_dispatch(Message *m, bool new_msg)
     mlogger->set(l_mdm_buf, buffer::get_total_alloc());
   }
 
-  // shut down?
-  if (is_stopping()) {
-    mdlog->trim();
-    if (mdcache->shutdown_pass()) {
-      dout(7) << "shutdown_pass=true, finished w/ shutdown, moving to down:stopped" << dendl;
-      stopping_done();
-    }
-    else {
-      dout(7) << "shutdown_pass=false" << dendl;
-    }
-  }
   return true;
 }