]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: check metadata pool not cluster is full 19830/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 19 Dec 2017 19:37:14 +0000 (11:37 -0800)
committerShinobu Kinjo <shinobu@redhat.com>
Mon, 8 Jan 2018 04:08:52 +0000 (13:08 +0900)
CEPH_OSDMAP_FULL flag was obsoleted by
b4ca5ae462c6f12ca48b787529938862646282cd. So, check if the metadata pool is
full instead which is a decent proxy (as metadata operations can still
proceed). However, the data pool may still be full which would result in some
operations still not completing (like inode backtrace updates).

Fixes: http://tracker.ceph.com/issues/22483
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit d678415bb03afd1a67edaa0eac031a6a9cf3fbf9)

src/mds/MDSRank.cc
src/mds/MDSRank.h
src/mds/Server.cc

index 51ae378947f57f30fbb44557670b2ce98e36a775..b0c323bf28b7da6b4da0299b7a40d7b2c120ecaf 100644 (file)
@@ -55,7 +55,7 @@ MDSRank::MDSRank(
     Context *suicide_hook_)
   :
     whoami(whoami_), incarnation(0),
-    mds_lock(mds_lock_), clog(clog_), timer(timer_),
+    mds_lock(mds_lock_), cct(msgr->cct), clog(clog_), timer(timer_),
     mdsmap(mdsmap_),
     objecter(new Objecter(g_ceph_context, msgr, monc_, nullptr, 0, 0)),
     server(NULL), mdcache(NULL), locker(NULL), mdlog(NULL),
@@ -97,7 +97,7 @@ MDSRank::MDSRank(
 
   objecter->unset_honor_osdmap_full();
 
-  finisher = new Finisher(msgr->cct);
+  finisher = new Finisher(cct);
 
   mdcache = new MDCache(this, purge_queue);
   mdlog = new MDLog(this);
@@ -112,10 +112,10 @@ MDSRank::MDSRank(
   server = new Server(this);
   locker = new Locker(this, mdcache);
 
-  op_tracker.set_complaint_and_threshold(msgr->cct->_conf->mds_op_complaint_time,
-                                         msgr->cct->_conf->mds_op_log_threshold);
-  op_tracker.set_history_size_and_duration(msgr->cct->_conf->mds_op_history_size,
-                                           msgr->cct->_conf->mds_op_history_duration);
+  op_tracker.set_complaint_and_threshold(cct->_conf->mds_op_complaint_time,
+                                         cct->_conf->mds_op_log_threshold);
+  op_tracker.set_history_size_and_duration(cct->_conf->mds_op_history_size,
+                                           cct->_conf->mds_op_history_duration);
 }
 
 MDSRank::~MDSRank()
index 7c6df739d90ce8f08eba1b15f321bae8dd8b65e0..170bb6ed5a5a5e354274792217897d396c5fc103 100644 (file)
@@ -136,6 +136,8 @@ class MDSRank {
     // a separate lock here in future potentially.
     Mutex &mds_lock;
 
+    class CephContext *cct;
+
     bool is_daemon_stopping() const;
 
     // Reference to global cluster log client, just to avoid initialising
index 38c44523e95c90b8858b4bf8b4c35e90d1e3976c..4ee39e3dc3c371dc10cd15d9d8300a4ccaec0665 100644 (file)
@@ -1716,7 +1716,8 @@ void Server::handle_osd_map()
    * using osdmap_full_flag(), because we want to know "is the flag set"
    * rather than "does the flag apply to us?" */
   mds->objecter->with_osdmap([this](const OSDMap& o) {
-      is_full = o.test_flag(CEPH_OSDMAP_FULL);
+      auto pi = o.get_pg_pool(mds->mdsmap->get_metadata_pool());
+      is_full = pi && pi->has_flag(pg_pool_t::FLAG_FULL);
       dout(7) << __func__ << ": full = " << is_full << " epoch = "
              << o.get_epoch() << dendl;
     });