From: Sage Weil Date: Wed, 18 Feb 2015 22:53:04 +0000 (-0800) Subject: osd,mon: explicitly specify OSD features in MOSDBoot X-Git-Tag: v0.93~10^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bee91548b07c6a28314dddc50fef8b6a2677e774;p=ceph.git osd,mon: explicitly specify OSD features in MOSDBoot 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 --- diff --git a/src/messages/MOSDBoot.h b/src/messages/MOSDBoot.h index bfe7775768f9..e59b03cf14e7 100644 --- a/src/messages/MOSDBoot.h +++ b/src/messages/MOSDBoot.h @@ -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 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; } }; diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index f1e4282d307e..18f22643a2b5 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -2968,7 +2968,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, diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 76ff2d994e8a..ad1a5c0daf1d 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1777,8 +1777,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 diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 27296bcefdec..aad4edf2be42 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4413,7 +4413,8 @@ void OSD::_send_boot() } MOSDBoot *mboot = new MOSDBoot(superblock, service.get_boot_epoch(), - hb_back_addr, hb_front_addr, cluster_addr); + 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