summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-11-05 07:21:27 -0800
committerSage Weil <sage@inktank.com>2012-11-30 13:18:02 -0800
commitcdb8b55548a800a98b437eec9d5254d9f1408cac (patch)
tree912c3cb6830b67804c07813b81fce673d4651ff7
parent662ac0b2f73b2924171286f08f85498c7e038aef (diff)
downloadceph-cdb8b55548a800a98b437eec9d5254d9f1408cac.tar.gz
osd: include up_from in MOSDPing
This identifies *which* instances of osd.NNN we are. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/messages/MOSDPing.h13
-rw-r--r--src/osd/OSD.cc6
2 files changed, 14 insertions, 5 deletions
diff --git a/src/messages/MOSDPing.h b/src/messages/MOSDPing.h
index 4451a478b1f..fcb2bea3bc8 100644
--- a/src/messages/MOSDPing.h
+++ b/src/messages/MOSDPing.h
@@ -23,7 +23,7 @@
class MOSDPing : public Message {
- static const int HEAD_VERSION = 2;
+ static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 1;
public:
@@ -52,10 +52,11 @@ class MOSDPing : public Message {
__u8 op;
osd_peer_stat_t peer_stat;
utime_t stamp;
+ epoch_t up_from;
- MOSDPing(const uuid_d& f, epoch_t e, __u8 o, utime_t s)
+ MOSDPing(const uuid_d& f, epoch_t e, __u8 o, utime_t s, epoch_t upf)
: Message(MSG_OSD_PING, HEAD_VERSION, COMPAT_VERSION),
- fsid(f), map_epoch(e), peer_as_of_epoch(0), op(o), stamp(s)
+ fsid(f), map_epoch(e), peer_as_of_epoch(0), op(o), stamp(s), up_from(upf)
{ }
MOSDPing()
: Message(MSG_OSD_PING, HEAD_VERSION, COMPAT_VERSION)
@@ -73,6 +74,10 @@ public:
::decode(peer_stat, p);
if (header.version >= 2)
::decode(stamp, p);
+ if (header.version >= 3)
+ ::decode(up_from, p);
+ else
+ up_from = 0;
}
void encode_payload(uint64_t features) {
::encode(fsid, payload);
@@ -81,6 +86,7 @@ public:
::encode(op, payload);
::encode(peer_stat, payload);
::encode(stamp, payload);
+ ::encode(up_from, payload);
}
const char *get_type_name() const { return "osd_ping"; }
@@ -89,6 +95,7 @@ public:
<< " e" << map_epoch
//<< " as_of " << peer_as_of_epoch
<< " stamp " << stamp
+ << " up_from " << up_from
<< ")";
}
};
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index d6ea0bc8da5..bbfa720a793 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -1915,7 +1915,8 @@ void OSD::handle_osd_ping(MOSDPing *m)
Message *r = new MOSDPing(monc->get_fsid(),
curmap->get_epoch(),
MOSDPing::PING_REPLY,
- m->stamp);
+ m->stamp,
+ up_epoch);
hbserver_messenger->send_message(r, m->get_connection());
if (curmap->is_up(from)) {
@@ -2057,7 +2058,8 @@ void OSD::heartbeat()
Message *m = new MOSDPing(monc->get_fsid(),
service.get_osdmap()->get_epoch(),
MOSDPing::PING,
- now);
+ now,
+ up_epoch);
i->second.last_tx = now;
if (i->second.first_tx == utime_t())
i->second.first_tx = now;