]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: require CEPH_FEATURE_OSD_TMAP2OMAP 998/head
authorSage Weil <sage@inktank.com>
Sat, 28 Dec 2013 20:23:22 +0000 (12:23 -0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Fri, 10 Jan 2014 23:41:40 +0000 (07:41 +0800)
Require that all OSDs support TMAP2OMAP before starting the MDS.  This
avoids doing some work and then crashing with EOPNOTSUPP, and gives us
a more informative message in the logs.

Signed-off-by: Sage Weil <sage@inktank.com>
PendingReleaseNotes
src/include/ceph_features.h
src/mds/MDS.cc
src/osdc/Objecter.h

index f813e86622c040a92a93d9be99cb0fe22f8eab81..9a9a0c094d85ff3162e5f24ffa5f1fcf46c47881 100644 (file)
@@ -6,3 +6,8 @@ v0.75
   non-plain format. This is consistent with the behavior for a pool
   which used to hold images, but contains none. Scripts relying on
   this behavior should be updated.
+
+- The MDS requires a new OSD operation TMAP2OMAP, added in this release.  When
+  upgrading, be sure to upgrade and restart the ceph-osd daemons before the
+  ceph-mds daemon.  The MDS will refuse to start if any up OSDs do not support
+  the new feature.
index d1cb1bc47c6dfdf12b370fd88122b0bc32d8ecb8..f6b56f10142470c2878ee176437f7f0ba4aa9bdb 100644 (file)
@@ -43,6 +43,7 @@
 #define CEPH_FEATURE_CRUSH_V2      (1ULL<<36)  /* new indep; SET_* steps */
 #define CEPH_FEATURE_EXPORT_PEER   (1ULL<<37)
 #define CEPH_FEATURE_OSD_ERASURE_CODES (1ULL<<38)
+#define CEPH_FEATURE_OSD_TMAP2OMAP (1ULL<<38)   /* overlap with EC */
 
 /*
  * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature
index c88a0240fe13f2c57caa2cb55a81a7f9083dbac2..c9df062eb77635e094b525ebdbc2e8e108fb9636 100644 (file)
@@ -479,6 +479,29 @@ int MDS::init(int wanted_state)
     return 0;
   }
 
+  objecter->init_locked();
+
+  monc->sub_want("mdsmap", 0, 0);
+  monc->renew_subs();
+
+  mds_lock.Unlock();
+
+  // verify that osds support tmap2omap
+  while (true) {
+    objecter->maybe_request_map();
+    objecter->wait_for_osd_map();
+    uint64_t osd_features = objecter->osdmap->get_up_osd_features();
+    if (osd_features & CEPH_FEATURE_OSD_TMAP2OMAP)
+      break;
+    derr << "*** one or more OSDs do not support TMAP2OMAP; upgrade OSDs before starting MDS (or downgrade MDS) ***" << dendl;
+    sleep(10);
+  }
+
+  mds_lock.Lock();
+  if (want_state == CEPH_MDS_STATE_DNE) {
+    suicide();  // we could do something more graceful here
+  }
+
   timer.init();
 
   if (wanted_state==MDSMap::STATE_BOOT && g_conf->mds_standby_replay)
@@ -516,11 +539,6 @@ int MDS::init(int wanted_state)
   whoami = -1;
   messenger->set_myname(entity_name_t::MDS(whoami));
   
-  objecter->init_locked();
-
-  monc->sub_want("mdsmap", 0, 0);
-  monc->renew_subs();
-
   // schedule tick
   reset_tick();
 
index 4b689424a3fa563b70704c6e855d9f7890ba8abd..3777c6de5f0b00aceae74518cec993475836c86a 100644 (file)
@@ -953,7 +953,9 @@ public:
   bool keep_balanced_budget;
   bool honor_osdmap_full;
 
+public:
   void maybe_request_map();
+private:
 
   version_t last_seen_osdmap_version;
   version_t last_seen_pgmap_version;