X-Git-Url: https://git.proxmox.com/?p=ceph.git;a=blobdiff_plain;f=ceph%2Fsrc%2Fmessages%2FMOSDRepScrub.h;h=f4f26ee1f2d45860ebd97a9d5211e145add12f90;hp=ce800aac068b3543fb981a595d0b27578912affd;hb=28e407b858acd3bddc89f68583571f771bb42e46;hpb=dfcb7b53b2e4fcd2a5af0240d4975adc711ab96e diff --git a/ceph/src/messages/MOSDRepScrub.h b/ceph/src/messages/MOSDRepScrub.h index ce800aac0..f4f26ee1f 100644 --- a/ceph/src/messages/MOSDRepScrub.h +++ b/ceph/src/messages/MOSDRepScrub.h @@ -24,7 +24,7 @@ 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 @@ -35,7 +35,9 @@ struct MOSDRepScrub : public MOSDFastDispatchOp { 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; @@ -50,11 +52,11 @@ struct MOSDRepScrub : public MOSDFastDispatchOp { 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), @@ -64,7 +66,9 @@ struct MOSDRepScrub : public MOSDFastDispatchOp { start(start), end(end), deep(deep), - seed(seed) { } + allow_preemption(preemption), + priority(prio), + high_priority(highprio) { } private: @@ -73,15 +77,18 @@ 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 { @@ -94,8 +101,11 @@ public: ::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(); @@ -108,12 +118,22 @@ public: ::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); + } } };