#include "MOSDFastDispatchOp.h"
class MOSDPGPull : public MOSDFastDispatchOp {
- static const int HEAD_VERSION = 2;
+ static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 2;
vector<PullOp> pulls;
public:
pg_shard_t from;
spg_t pgid;
- epoch_t map_epoch;
+ epoch_t map_epoch, min_epoch;
uint64_t cost;
epoch_t get_map_epoch() const override {
return map_epoch;
}
+ epoch_t get_min_epoch() const override {
+ return min_epoch;
+ }
spg_t get_spg() const override {
return pgid;
}
::decode(cost, p);
::decode(pgid.shard, p);
::decode(from, p);
+ if (header.version >= 3) {
+ ::decode(min_epoch, p);
+ } else {
+ min_epoch = map_epoch;
+ }
}
void encode_payload(uint64_t features) override {
::encode(cost, payload);
::encode(pgid.shard, payload);
::encode(from, payload);
+ ::encode(min_epoch, payload);
}
const char *get_type_name() const override { return "MOSDPGPull"; }
void print(ostream& out) const override {
out << "MOSDPGPull(" << pgid
- << " e" << map_epoch
+ << " e" << map_epoch << "/" << min_epoch
<< " cost " << cost
<< ")";
}
#include "MOSDFastDispatchOp.h"
class MOSDPGPush : public MOSDFastDispatchOp {
- static const int HEAD_VERSION = 2;
+ static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 2;
public:
pg_shard_t from;
spg_t pgid;
- epoch_t map_epoch;
+ epoch_t map_epoch, min_epoch;
vector<PushOp> pushes;
private:
epoch_t get_map_epoch() const override {
return map_epoch;
}
+ epoch_t get_min_epoch() const override {
+ return min_epoch;
+ }
spg_t get_spg() const override {
return pgid;
}
::decode(cost, p);
::decode(pgid.shard, p);
::decode(from, p);
+ if (header.version >= 3) {
+ ::decode(min_epoch, p);
+ } else {
+ min_epoch = map_epoch;
+ }
}
void encode_payload(uint64_t features) override {
::encode(cost, payload);
::encode(pgid.shard, payload);
::encode(from, payload);
+ ::encode(min_epoch, payload);
}
const char *get_type_name() const override { return "MOSDPGPush"; }
void print(ostream& out) const override {
out << "MOSDPGPush(" << pgid
- << " " << map_epoch
+ << " " << map_epoch << "/" << min_epoch
<< " " << pushes;
out << ")";
}
#include "MOSDFastDispatchOp.h"
class MOSDPGPushReply : public MOSDFastDispatchOp {
- static const int HEAD_VERSION = 2;
+ static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 2;
public:
pg_shard_t from;
spg_t pgid;
- epoch_t map_epoch;
+ epoch_t map_epoch, min_epoch;
vector<PushReplyOp> replies;
uint64_t cost;
epoch_t get_map_epoch() const override {
return map_epoch;
}
+ epoch_t get_min_epoch() const override {
+ return min_epoch;
+ }
spg_t get_spg() const override {
return pgid;
}
::decode(cost, p);
::decode(pgid.shard, p);
::decode(from, p);
+ if (header.version >= 3) {
+ ::decode(min_epoch, p);
+ } else {
+ min_epoch = map_epoch;
+ }
}
void encode_payload(uint64_t features) override {
::encode(cost, payload);
::encode(pgid.shard, payload);
::encode(from, payload);
+ ::encode(min_epoch, payload);
}
void print(ostream& out) const override {
out << "MOSDPGPushReply(" << pgid
- << " " << map_epoch
+ << " " << map_epoch << "/" << min_epoch
<< " " << replies;
out << ")";
}
MOSDPGPush *msg = new MOSDPGPush();
msg->set_priority(priority);
msg->map_epoch = get_parent()->get_epoch();
+ msg->min_epoch = get_parent()->get_last_peering_reset_epoch();
msg->from = get_parent()->whoami_shard();
msg->pgid = spg_t(get_parent()->get_info().pgid.pgid, i->first.shard);
msg->pushes.swap(i->second);
MOSDPGPushReply *msg = new MOSDPGPushReply();
msg->set_priority(priority);
msg->map_epoch = get_parent()->get_epoch();
+ msg->min_epoch = get_parent()->get_last_peering_reset_epoch();
msg->from = get_parent()->whoami_shard();
msg->pgid = spg_t(get_parent()->get_info().pgid.pgid, i->first.shard);
msg->replies.swap(i->second);
reply->set_priority(m->get_priority());
reply->pgid = get_info().pgid;
reply->map_epoch = m->map_epoch;
+ reply->min_epoch = m->min_epoch;
reply->replies.swap(replies);
reply->compute_cost(cct);
reply->set_priority(m->get_priority());
reply->pgid = get_info().pgid;
reply->map_epoch = m->map_epoch;
+ reply->min_epoch = m->min_epoch;
reply->set_pulls(&replies);
reply->compute_cost(cct);
msg->from = get_parent()->whoami_shard();
msg->pgid = get_parent()->primary_spg_t();
msg->map_epoch = get_osdmap()->get_epoch();
+ msg->min_epoch = get_parent()->get_last_peering_reset_epoch();
msg->set_priority(prio);
for (;
(j != i->second.end() &&
msg->set_priority(prio);
msg->pgid = get_parent()->primary_spg_t();
msg->map_epoch = get_osdmap()->get_epoch();
+ msg->min_epoch = get_parent()->get_last_peering_reset_epoch();
msg->set_pulls(&i->second);
msg->compute_cost(cct);
get_parent()->send_message_osd_cluster(msg, con);