#include "osd/osd_types.h"
class MOSDPGInfo : public Message {
- static const int HEAD_VERSION = 4;
+ static const int HEAD_VERSION = 5;
static const int COMPAT_VERSION = 1;
epoch_t epoch;
// v2 needs the PastIntervals for each record
for (vector<pair<pg_notify_t,PastIntervals> >::iterator p = pg_list.begin();
p != pg_list.end();
- p++)
- ::encode(p->second, payload);
+ p++) {
+ if (HAVE_FEATURE(features, SERVER_LUMINOUS)) {
+ ::encode(p->second, payload);
+ } else {
+ header.version = 4;
+ p->second.encode_classic(payload);
+ }
+ }
// v3 needs epoch_sent, query_epoch
for (vector<pair<pg_notify_t,PastIntervals> >::iterator p = pg_list.begin();
if (header.version >= 2) {
// get the PastIntervals portion
for (unsigned i=0; i<n; i++) {
- ::decode(pg_list[i].second, p);
+ if (header.version >= 5) {
+ ::decode(pg_list[i].second, p);
+ } else {
+ pg_list[i].second.decode_classic(p);
+ }
}
}
class MOSDPGLog : public Message {
- static const int HEAD_VERSION = 4;
+ static const int HEAD_VERSION = 5;
static const int COMPAT_VERSION = 2;
epoch_t epoch;
::encode(log, payload);
::encode(missing, payload);
::encode(query_epoch, payload);
- ::encode(past_intervals, payload);
+ if (HAVE_FEATURE(features, SERVER_LUMINOUS)) {
+ ::encode(past_intervals, payload);
+ } else {
+ header.version = 4;
+ past_intervals.encode_classic(payload);
+ }
::encode(to, payload);
::encode(from, payload);
}
::decode(query_epoch, p);
}
if (header.version >= 3) {
- ::decode(past_intervals, p);
+ if (header.version >= 5) {
+ ::decode(past_intervals, p);
+ } else {
+ past_intervals.decode_classic(p);
+ }
}
if (header.version >= 4) {
::decode(to, p);
class MOSDPGNotify : public Message {
- static const int HEAD_VERSION = 5;
+ static const int HEAD_VERSION = 6;
static const int COMPAT_VERSION = 2;
epoch_t epoch;
// v3 needs the PastIntervals for each record
for (vector<pair<pg_notify_t,PastIntervals> >::iterator p = pg_list.begin();
p != pg_list.end();
- p++)
- ::encode(p->second, payload);
+ p++) {
+ if (HAVE_FEATURE(features, SERVER_LUMINOUS)) {
+ ::encode(p->second, payload);
+ } else {
+ header.version = 5;
+ p->second.encode_classic(payload);
+ }
+ }
// v4 needs epoch_sent, query_epoch
for (vector<pair<pg_notify_t,PastIntervals> >::iterator p = pg_list.begin();
if (header.version >= 3) {
// get the PastIntervals portion
for (unsigned i=0; i<n; i++) {
- ::decode(pg_list[i].second, p);
+ if (header.version >= 6) {
+ ::decode(pg_list[i].second, p);
+ } else {
+ pg_list[i].second.decode_classic(p);
+ }
}
}