From: Joao Eduardo Luis Date: Mon, 23 Dec 2013 01:26:59 +0000 (-0800) Subject: mon: Monitor: Forward connection features X-Git-Tag: v0.75~43^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b4fbe4f81348be74c654f3dae1c20a961b99c895;p=ceph.git mon: Monitor: Forward connection features We are relying on connection features to track OSD supported features. However, we were not forwarding connection features when we forwarded a message from a peon to the leader. That was breaking the OSD feature tracking. Fixes: 7051 Signed-off-by: Joao Eduardo Luis --- diff --git a/src/messages/MForward.h b/src/messages/MForward.h index 7c88aba8964..45f59b29d6f 100644 --- a/src/messages/MForward.h +++ b/src/messages/MForward.h @@ -28,17 +28,26 @@ struct MForward : public Message { PaxosServiceMessage *msg; entity_inst_t client; MonCap client_caps; - - MForward() : Message(MSG_FORWARD), tid(0), msg(NULL) {} + uint64_t conn_features; + + static const int HEAD_VERSION = 2; + static const int COMPAT_VERSION = 0; + + MForward() : Message(MSG_FORWARD, HEAD_VERSION, COMPAT_VERSION), + tid(0), msg(NULL), conn_features(0) {} //the message needs to have caps filled in! MForward(uint64_t t, PaxosServiceMessage *m) : - Message(MSG_FORWARD), tid(t), msg(m) { + Message(MSG_FORWARD, HEAD_VERSION, COMPAT_VERSION), + tid(t), msg(m) { client = m->get_source_inst(); client_caps = m->get_session()->caps; + conn_features = m->get_connection()->get_features(); } MForward(uint64_t t, PaxosServiceMessage *m, const MonCap& caps) : - Message(MSG_FORWARD), tid(t), msg(m), client_caps(caps) { + Message(MSG_FORWARD, HEAD_VERSION, COMPAT_VERSION), + tid(t), msg(m), client_caps(caps) { client = m->get_source_inst(); + conn_features = m->get_connection()->get_features(); } private: ~MForward() { @@ -51,6 +60,7 @@ public: ::encode(client, payload); ::encode(client_caps, payload, features); encode_message(msg, features, payload); + ::encode(conn_features, payload); } void decode_payload() { @@ -59,12 +69,19 @@ public: ::decode(client, p); ::decode(client_caps, p); msg = (PaxosServiceMessage *)decode_message(NULL, p); + if (header.version >= 2) { + ::decode(conn_features, p); + } else { + conn_features = 0; + } + } const char *get_type_name() const { return "forward"; } void print(ostream& o) const { if (msg) - o << "forward(" << *msg << " caps " << client_caps << ") to leader"; + o << "forward(" << *msg << " caps " << client_caps + << " conn_features " << conn_features << ") to leader"; else o << "forward(??? ) to leader"; } }; diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index c0d7b6f349d..fc3a66e4d0f 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -2419,6 +2419,7 @@ void Monitor::handle_forward(MForward *m) c->set_priv(s); c->set_peer_addr(m->client.addr); c->set_peer_type(m->client.name.type()); + c->set_features(m->conn_features); s->caps = m->client_caps; dout(10) << " caps are " << s->caps << dendl;