diff options
author | Sage Weil <sage@redhat.com> | 2014-12-16 17:49:44 +0100 |
---|---|---|
committer | Sage Weil <sage@redhat.com> | 2014-12-16 17:49:44 +0100 |
commit | eef1705354d7661914dd09adc9627d52e03ac8dc (patch) | |
tree | 72156eafd769bfdfe9dd4e6e34aa2a8e08f7039a /src/messages | |
parent | Merge pull request #3166 from ceph/wip-librados-fadvise (diff) | |
parent | mon/OSDMonitor: dump inc and full maps we get a crc mismatch (diff) | |
download | ceph-eef1705354d7661914dd09adc9627d52e03ac8dc.tar.xz ceph-eef1705354d7661914dd09adc9627d52e03ac8dc.zip |
Merge pull request #2300 from ceph/wip-osdmap
add osdmap checksums
sage-2014-12-16_06:27:10-rados:singleton-wip-sage-testing2-distro-basic-multi
sage-2014-12-15_13:18:23-rados:thrash-wip-sage-testing2-distro-basic-multi
Reviewed-by: Samuel Just <sjust@redhat.com>
Diffstat (limited to 'src/messages')
-rw-r--r-- | src/messages/MMonGetOSDMap.h | 87 | ||||
-rw-r--r-- | src/messages/MOSDMap.h | 7 | ||||
-rw-r--r-- | src/messages/Makefile.am | 1 |
3 files changed, 90 insertions, 5 deletions
diff --git a/src/messages/MMonGetOSDMap.h b/src/messages/MMonGetOSDMap.h new file mode 100644 index 00000000000..859d253f631 --- /dev/null +++ b/src/messages/MMonGetOSDMap.h @@ -0,0 +1,87 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +/* + * Ceph - scalable distributed file system + * + * Copyright (C) 2014 Red Hat + * + * This is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software + * Foundation. See file COPYING. + * + */ + +#ifndef CEPH_MMONGETOSDMAP_H +#define CEPH_MMONGETOSDMAP_H + +#include "msg/Message.h" + +#include "include/types.h" + +class MMonGetOSDMap : public PaxosServiceMessage { + epoch_t full_first, full_last; + epoch_t inc_first, inc_last; + +public: + MMonGetOSDMap() + : PaxosServiceMessage(CEPH_MSG_MON_GET_OSDMAP, 0), + full_first(0), + full_last(0), + inc_first(0), + inc_last(0) { } +private: + ~MMonGetOSDMap() {} + +public: + void request_full(epoch_t first, epoch_t last) { + assert(last >= first); + full_first = first; + full_last = last; + } + void request_inc(epoch_t first, epoch_t last) { + assert(last >= first); + inc_first = first; + inc_last = last; + } + epoch_t get_full_first() const { + return full_first; + } + epoch_t get_full_last() const { + return full_last; + } + epoch_t get_inc_first() const { + return inc_first; + } + epoch_t get_inc_last() const { + return inc_last; + } + + const char *get_type_name() const { return "mon_get_osdmap"; } + void print(ostream& out) const { + out << "mon_get_osdmap("; + if (full_first && full_last) + out << "full " << full_first << "-" << full_last; + if (inc_first && inc_last) + out << " inc" << inc_first << "-" << inc_last; + out << ")"; + } + + void encode_payload(uint64_t features) { + paxos_encode(); + ::encode(full_first, payload); + ::encode(full_last, payload); + ::encode(inc_first, payload); + ::encode(inc_last, payload); + } + void decode_payload() { + bufferlist::iterator p = payload.begin(); + paxos_decode(p); + ::decode(full_first, p); + ::decode(full_last, p); + ::decode(inc_first, p); + ::decode(inc_last, p); + } +}; + +#endif diff --git a/src/messages/MOSDMap.h b/src/messages/MOSDMap.h index 7ed601c6b36..9c15290b7e9 100644 --- a/src/messages/MOSDMap.h +++ b/src/messages/MOSDMap.h @@ -57,13 +57,10 @@ class MOSDMap : public Message { MOSDMap() : Message(CEPH_MSG_OSD_MAP, HEAD_VERSION) { } - MOSDMap(const uuid_d &f, OSDMap *oc=0) + MOSDMap(const uuid_d &f) : Message(CEPH_MSG_OSD_MAP, HEAD_VERSION), fsid(f), - oldest_map(0), newest_map(0) { - if (oc) - oc->encode(maps[oc->get_epoch()]); - } + oldest_map(0), newest_map(0) { } private: ~MOSDMap() {} diff --git a/src/messages/Makefile.am b/src/messages/Makefile.am index cac40482b00..38593f7e724 100644 --- a/src/messages/Makefile.am +++ b/src/messages/Makefile.am @@ -56,6 +56,7 @@ noinst_HEADERS += \ messages/MMonCommandAck.h \ messages/MMonElection.h \ messages/MMonGetMap.h \ + messages/MMonGetOSDMap.h \ messages/MMonGetVersion.h \ messages/MMonGetVersionReply.h \ messages/MMonGlobalID.h \ |