struct MOSDRepScrub : public MOSDFastDispatchOp {
- static const int HEAD_VERSION = 8;
+ static const int HEAD_VERSION = 9;
static const int COMPAT_VERSION = 6;
spg_t pgid; // PG to scrub
hobject_t end; // upper bound of scrub, exclusive
bool deep; // true if scrub should be deep
bool allow_preemption = false;
+ int32_t priority = 0;
+ bool high_priority = false;
epoch_t get_map_epoch() const override {
return map_epoch;
MOSDRepScrub(spg_t pgid, eversion_t scrub_to, epoch_t map_epoch, epoch_t min_epoch,
hobject_t start, hobject_t end, bool deep,
- bool preemption)
+ 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),
- allow_preemption(preemption) { }
+ allow_preemption(preemption),
+ priority(prio),
+ high_priority(highprio) { }
private:
<< ",deep:" << deep
<< ",version:" << header.version
<< ",allow_preemption:" << (int)allow_preemption
+ << ",priority=" << priority
+ << (high_priority ? " (high)":"")
<< ")";
}
::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();
if (header.version >= 8) {
::decode(allow_preemption, p);
}
+ if (header.version >= 9) {
+ ::decode(priority, p);
+ ::decode(high_priority, p);
+ }
}
};
get_osdmap()->get_epoch(),
get_last_peering_reset(),
start, end, deep,
- allow_preemption);
+ allow_preemption,
+ scrubber.priority,
+ ops_blocked_by_scrub());
// default priority, we want the rep scrub processed prior to any recovery
// or client io messages (we are holding a lock!)
osd->send_message_osd_cluster(
scrubber.end = msg->end;
scrubber.deep = msg->deep;
scrubber.epoch_start = info.history.same_interval_since;
+ if (msg->priority) {
+ scrubber.priority = msg->priority;
+ } else {
+ scrubber.priority = get_scrub_priority();
+ }
scrub_can_preempt = msg->allow_preemption;
scrub_preempted = false;
scrubber.replica_scrubmap_pos.reset();
- requeue_scrub(false);
+ requeue_scrub(msg->high_priority);
}
/* Scrub: