]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd,mon: explicitly specify OSD features in MOSDBoot 4960/head
authorSage Weil <sage@redhat.com>
Wed, 18 Feb 2015 22:53:04 +0000 (14:53 -0800)
committerDavid Zafman <dzafman@redhat.com>
Mon, 15 Jun 2015 15:23:13 +0000 (08:23 -0700)
We are using the connection features to populate the features field in the
OSDMap, but this is the *intersection* of mon and osd features, not the
osd features.  Fix this by explicitly specifying the features in
MOSDBoot.

Fixes: #10911
Backport: giant, firefly
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit bee91548b07c6a28314dddc50fef8b6a2677e774)

Conflicts:
src/osd/OSD.cc
Minor difference in the MOSDBoot constructor

src/messages/MOSDBoot.h
src/mon/Monitor.cc
src/mon/OSDMonitor.cc
src/osd/OSD.cc

index bfe7775768f96e92b3b61725d9a872823a99fb28..e59b03cf14e739596a058aa31e08a6b78088db08 100644 (file)
@@ -22,7 +22,7 @@
 
 class MOSDBoot : public PaxosServiceMessage {
 
-  static const int HEAD_VERSION = 5;
+  static const int HEAD_VERSION = 6;
   static const int COMPAT_VERSION = 2;
 
  public:
@@ -31,21 +31,24 @@ class MOSDBoot : public PaxosServiceMessage {
   entity_addr_t cluster_addr;
   epoch_t boot_epoch;  // last epoch this daemon was added to the map (if any)
   map<string,string> metadata; ///< misc metadata about this osd
+  uint64_t osd_features;
 
   MOSDBoot()
     : PaxosServiceMessage(MSG_OSD_BOOT, 0, HEAD_VERSION, COMPAT_VERSION),
-      boot_epoch(0)
+      boot_epoch(0), osd_features(0)
   { }
   MOSDBoot(OSDSuperblock& s, epoch_t be,
           const entity_addr_t& hb_back_addr_ref,
           const entity_addr_t& hb_front_addr_ref,
-           const entity_addr_t& cluster_addr_ref)
+           const entity_addr_t& cluster_addr_ref,
+          uint64_t feat)
     : PaxosServiceMessage(MSG_OSD_BOOT, s.current_epoch, HEAD_VERSION, COMPAT_VERSION),
       sb(s),
       hb_back_addr(hb_back_addr_ref),
       hb_front_addr(hb_front_addr_ref),
       cluster_addr(cluster_addr_ref),
-      boot_epoch(be)
+      boot_epoch(be),
+      osd_features(feat)
   { }
   
 private:
@@ -54,7 +57,9 @@ private:
 public:
   const char *get_type_name() const { return "osd_boot"; }
   void print(ostream& out) const {
-    out << "osd_boot(osd." << sb.whoami << " booted " << boot_epoch << " v" << version << ")";
+    out << "osd_boot(osd." << sb.whoami << " booted " << boot_epoch
+       << " features " << osd_features
+       << " v" << version << ")";
   }
   
   void encode_payload(uint64_t features) {
@@ -65,6 +70,7 @@ public:
     ::encode(boot_epoch, payload);
     ::encode(hb_front_addr, payload);
     ::encode(metadata, payload);
+    ::encode(osd_features, payload);
   }
   void decode_payload() {
     bufferlist::iterator p = payload.begin();
@@ -79,6 +85,10 @@ public:
       ::decode(hb_front_addr, p);
     if (header.version >= 5)
       ::decode(metadata, p);
+    if (header.version >= 6)
+      ::decode(osd_features, p);
+    else
+      osd_features = 0;
   }
 };
 
index 2240e4189fd853380a291afe9e7fa6a8888f85ff..c39faad23e27660a876b5c7e38494e95b75370d0 100644 (file)
@@ -2577,7 +2577,8 @@ void Monitor::forward_request_leader(PaxosServiceMessage *req)
     routed_requests[rr->tid] = rr;
     session->routed_request_tids.insert(rr->tid);
     
-    dout(10) << "forward_request " << rr->tid << " request " << *req << dendl;
+    dout(10) << "forward_request " << rr->tid << " request " << *req
+            << " features " << rr->con_features << dendl;
 
     MForward *forward = new MForward(rr->tid, req,
                                     rr->con_features,
index 510b727903f3fe18b7e69f671f844e8c098a88dc..861fac8cd901db40804b31af0af093c47584e58b 100644 (file)
@@ -1349,8 +1349,13 @@ bool OSDMonitor::prepare_boot(MOSDBoot *m)
        xi.laggy_probability * (1.0 - g_conf->mon_osd_laggy_weight);
       dout(10) << " laggy, now xi " << xi << dendl;
     }
+
     // set features shared by the osd
-    xi.features = m->get_connection()->get_features();
+    if (m->osd_features)
+      xi.features = m->osd_features;
+    else
+      xi.features = m->get_connection()->get_features();
+
     pending_inc.new_xinfo[from] = xi;
 
     // wait
index c0f4bdd0e8ebbc94239bcf9ff09a6250631b054d..d2c0a341ab8263c064b485b7758de229431eba06 100644 (file)
@@ -3771,7 +3771,9 @@ void OSD::_send_boot()
     dout(10) << " assuming hb_front_addr ip matches client_addr" << dendl;
   }
 
-  MOSDBoot *mboot = new MOSDBoot(superblock, boot_epoch, hb_back_addr, hb_front_addr, cluster_addr);
+  MOSDBoot *mboot = new MOSDBoot(superblock, boot_epoch,
+                                 hb_back_addr, hb_front_addr, cluster_addr,
+                                 CEPH_FEATURES_ALL);
   dout(10) << " client_addr " << client_messenger->get_myaddr()
           << ", cluster_addr " << cluster_addr
           << ", hb_back_addr " << hb_back_addr