struct MOSDRepScrub : public MOSDFastDispatchOp {
- static const int HEAD_VERSION = 7;
+ static const int HEAD_VERSION = 9;
static const int COMPAT_VERSION = 6;
spg_t pgid; // PG to scrub
hobject_t start; // lower bound of scrub, inclusive
hobject_t end; // upper bound of scrub, exclusive
bool deep; // true if scrub should be deep
- uint32_t seed; // seed value for digest calculation
+ bool allow_preemption = false;
+ int32_t priority = 0;
+ bool high_priority = false;
epoch_t get_map_epoch() const override {
return map_epoch;
MOSDRepScrub()
: MOSDFastDispatchOp(MSG_OSD_REP_SCRUB, HEAD_VERSION, COMPAT_VERSION),
chunky(false),
- deep(false),
- seed(0) { }
+ deep(false) { }
MOSDRepScrub(spg_t pgid, eversion_t scrub_to, epoch_t map_epoch, epoch_t min_epoch,
- hobject_t start, hobject_t end, bool deep, uint32_t seed)
+ hobject_t start, hobject_t end, bool deep,
+ bool preemption, int prio, bool highprio)
: MOSDFastDispatchOp(MSG_OSD_REP_SCRUB, HEAD_VERSION, COMPAT_VERSION),
pgid(pgid),
scrub_to(scrub_to),
start(start),
end(end),
deep(deep),
- seed(seed) { }
+ allow_preemption(preemption),
+ priority(prio),
+ high_priority(highprio) { }
private:
public:
const char *get_type_name() const override { return "replica scrub"; }
void print(ostream& out) const override {
- out << "replica scrub(pg: ";
- out << pgid << ",from:" << scrub_from << ",to:" << scrub_to
+ out << "replica_scrub(pg: " << pgid
+ << ",from:" << scrub_from
+ << ",to:" << scrub_to
<< ",epoch:" << map_epoch << "/" << min_epoch
<< ",start:" << start << ",end:" << end
<< ",chunky:" << chunky
<< ",deep:" << deep
- << ",seed:" << seed
- << ",version:" << header.version;
- out << ")";
+ << ",version:" << header.version
+ << ",allow_preemption:" << (int)allow_preemption
+ << ",priority=" << priority
+ << (high_priority ? " (high)":"")
+ << ")";
}
void encode_payload(uint64_t features) override {
::encode(end, payload);
::encode(deep, payload);
::encode(pgid.shard, payload);
- ::encode(seed, payload);
+ ::encode((uint32_t)-1, payload); // seed
::encode(min_epoch, payload);
+ ::encode(allow_preemption, payload);
+ ::encode(priority, payload);
+ ::encode(high_priority, payload);
}
void decode_payload() override {
bufferlist::iterator p = payload.begin();
::decode(end, p);
::decode(deep, p);
::decode(pgid.shard, p);
- ::decode(seed, p);
+ {
+ uint32_t seed;
+ ::decode(seed, p);
+ }
if (header.version >= 7) {
::decode(min_epoch, p);
} else {
min_epoch = map_epoch;
}
+ if (header.version >= 8) {
+ ::decode(allow_preemption, p);
+ }
+ if (header.version >= 9) {
+ ::decode(priority, p);
+ ::decode(high_priority, p);
+ }
}
};