]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages/MOSDBeacon: add beacon msg
authorKefu Chai <kchai@redhat.com>
Fri, 10 Mar 2017 17:27:59 +0000 (01:27 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 30 Mar 2017 12:21:17 +0000 (20:21 +0800)
osd will send beacon message to monitor periodically to inform it that
"i am still alive!", previously, monitor use the pg-stats to check the
status of OSD, but since osd will only send pg stat to mgr after
luminous, we use a dedicated msg for this purpose.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/messages/MOSDBeacon.h [new file with mode: 0644]
src/msg/Message.cc
src/msg/Message.h

diff --git a/src/messages/MOSDBeacon.h b/src/messages/MOSDBeacon.h
new file mode 100644 (file)
index 0000000..e431fce
--- /dev/null
@@ -0,0 +1,19 @@
+#pragma once
+
+class MOSDBeacon : public PaxosServiceMessage {
+public:
+  MOSDBeacon(epoch_t e = 0)
+    : PaxosServiceMessage(MSG_OSD_BEACON, e)
+    {}
+  void encode_payload(uint64_t features) override {
+    paxos_encode();
+  }
+  void decode_payload() override {
+    bufferlist::iterator p = payload.begin();
+    paxos_decode(p);
+  }
+  const char *get_type_name() const override { return "osd_beacon"; }
+  void print(ostream &out) const {
+    out << get_type_name();
+  }
+};
index 632bc92606a2fa752fdb014ec4e5da077f9aa57c..8b5cb0a98f0c37f5568b0bcd336409831053a526 100644 (file)
@@ -57,6 +57,7 @@ using namespace std;
 
 #include "messages/MOSDBoot.h"
 #include "messages/MOSDAlive.h"
+#include "messages/MOSDBeacon.h"
 #include "messages/MOSDPGTemp.h"
 #include "messages/MOSDFailure.h"
 #include "messages/MOSDMarkMeDown.h"
@@ -425,6 +426,9 @@ Message *decode_message(CephContext *cct, int crcflags,
   case MSG_OSD_ALIVE:
     m = new MOSDAlive();
     break;
+  case MSG_OSD_BEACON:
+    m = new MOSDBeacon();
+    break;
   case MSG_OSD_PGTEMP:
     m = new MOSDPGTemp;
     break;
index 455c31adf46c154bebfd87058a355d75bf1597e5..da35ce08ef2ba5000656f08f36fd0a920559d22f 100644 (file)
@@ -72,6 +72,8 @@
 
 #define MSG_OSD_PGTEMP       78
 
+#define MSG_OSD_BEACON       79
+
 #define MSG_OSD_PG_NOTIFY      80
 #define MSG_OSD_PG_QUERY       81
 #define MSG_OSD_PG_LOG         83