From: Sage Weil Date: Thu, 24 Aug 2017 16:43:04 +0000 (-0400) Subject: messages/MOSDPGNotify: drop pre-luminous compat X-Git-Tag: v13.0.1~1107^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=99e8e36fb909bd0a3ff92305c91ad5445c6e8070;p=ceph.git messages/MOSDPGNotify: drop pre-luminous compat Signed-off-by: Sage Weil --- diff --git a/src/messages/MOSDPGNotify.h b/src/messages/MOSDPGNotify.h index a73bf05692a4..153d57764e11 100644 --- a/src/messages/MOSDPGNotify.h +++ b/src/messages/MOSDPGNotify.h @@ -26,7 +26,7 @@ class MOSDPGNotify : public Message { static const int HEAD_VERSION = 6; - static const int COMPAT_VERSION = 2; + static const int COMPAT_VERSION = 6; epoch_t epoch = 0; /// query_epoch is the epoch of the query being responded to, or @@ -58,109 +58,12 @@ public: const char *get_type_name() const override { return "PGnot"; } void encode_payload(uint64_t features) override { - if (HAVE_FEATURE(features, SERVER_LUMINOUS)) { - header.version = HEAD_VERSION; - } else { - // for jewel+kraken compat only - header.version = 5; - - // Use query_epoch for first entry for backwards compatibility - epoch_t query_epoch = epoch; - if (pg_list.size()) - query_epoch = pg_list.begin()->first.query_epoch; - - ::encode(epoch, payload); - - // v2 was vector - __u32 n = pg_list.size(); - ::encode(n, payload); - for (auto p = pg_list.begin(); - p != pg_list.end(); - p++) - ::encode(p->first.info, payload); - - ::encode(query_epoch, payload); - - // v3 needs the PastIntervals for each record - for (auto p = pg_list.begin(); - p != pg_list.end(); - p++) { - p->second.encode_classic(payload); - } - - // v4 needs epoch_sent, query_epoch - for (vector >::iterator p = pg_list.begin(); - p != pg_list.end(); - p++) - ::encode(pair( - p->first.epoch_sent, p->first.query_epoch), - payload); - - // v5 needs from, to - for (vector >::iterator p = pg_list.begin(); - p != pg_list.end(); - ++p) { - ::encode(p->first.from, payload); - ::encode(p->first.to, payload); - } - return; - } - ::encode(epoch, payload); ::encode(pg_list, payload); } void decode_payload() override { bufferlist::iterator p = payload.begin(); - if (header.version < 6) { - // for kraken+jewel compat only - epoch_t query_epoch; - ::decode(epoch, p); - - // decode pg_info_t portion of the vector - __u32 n; - ::decode(n, p); - pg_list.resize(n); - for (unsigned i=0; i= 3) { - // get the PastIntervals portion - for (unsigned i=0; i= 4) { - pair dec; - ::decode(dec, p); - i->first.epoch_sent = dec.first; - i->first.query_epoch = dec.second; - } else { - i->first.epoch_sent = epoch; - i->first.query_epoch = query_epoch; - } - } - - // v5 needs from and to - if (header.version >= 5) { - for (auto i = pg_list.begin(); - i != pg_list.end(); - i++) { - ::decode(i->first.from, p); - ::decode(i->first.to, p); - } - } - return; - } - ::decode(epoch, p); ::decode(pg_list, p); }