mirror of
https://github.com/ceph/ceph
synced 2025-02-23 11:07:35 +00:00
osd: min_epoch for MOSDRepScrub
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
200f90b753
commit
602c5bfd89
@ -24,13 +24,13 @@
|
||||
|
||||
struct MOSDRepScrub : public MOSDFastDispatchOp {
|
||||
|
||||
static const int HEAD_VERSION = 6;
|
||||
static const int HEAD_VERSION = 7;
|
||||
static const int COMPAT_VERSION = 6;
|
||||
|
||||
spg_t pgid; // PG to scrub
|
||||
eversion_t scrub_from; // only scrub log entries after scrub_from
|
||||
eversion_t scrub_to; // last_update_applied when message sent
|
||||
epoch_t map_epoch;
|
||||
epoch_t map_epoch, min_epoch;
|
||||
bool chunky; // true for chunky scrubs
|
||||
hobject_t start; // lower bound of scrub, inclusive
|
||||
hobject_t end; // upper bound of scrub, exclusive
|
||||
@ -40,6 +40,9 @@ struct MOSDRepScrub : public MOSDFastDispatchOp {
|
||||
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;
|
||||
}
|
||||
@ -50,12 +53,13 @@ struct MOSDRepScrub : public MOSDFastDispatchOp {
|
||||
deep(false),
|
||||
seed(0) { }
|
||||
|
||||
MOSDRepScrub(spg_t pgid, eversion_t scrub_to, epoch_t 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, uint32_t seed)
|
||||
: MOSDFastDispatchOp(MSG_OSD_REP_SCRUB, HEAD_VERSION, COMPAT_VERSION),
|
||||
pgid(pgid),
|
||||
scrub_to(scrub_to),
|
||||
map_epoch(map_epoch),
|
||||
min_epoch(min_epoch),
|
||||
chunky(true),
|
||||
start(start),
|
||||
end(end),
|
||||
@ -71,7 +75,8 @@ public:
|
||||
void print(ostream& out) const override {
|
||||
out << "replica scrub(pg: ";
|
||||
out << pgid << ",from:" << scrub_from << ",to:" << scrub_to
|
||||
<< ",epoch:" << map_epoch << ",start:" << start << ",end:" << end
|
||||
<< ",epoch:" << map_epoch << "/" << min_epoch
|
||||
<< ",start:" << start << ",end:" << end
|
||||
<< ",chunky:" << chunky
|
||||
<< ",deep:" << deep
|
||||
<< ",seed:" << seed
|
||||
@ -90,6 +95,7 @@ public:
|
||||
::encode(deep, payload);
|
||||
::encode(pgid.shard, payload);
|
||||
::encode(seed, payload);
|
||||
::encode(min_epoch, payload);
|
||||
}
|
||||
void decode_payload() override {
|
||||
bufferlist::iterator p = payload.begin();
|
||||
@ -103,6 +109,11 @@ public:
|
||||
::decode(deep, p);
|
||||
::decode(pgid.shard, p);
|
||||
::decode(seed, p);
|
||||
if (header.version >= 7) {
|
||||
::decode(min_epoch, p);
|
||||
} else {
|
||||
min_epoch = map_epoch;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -3720,6 +3720,7 @@ void PG::_request_scrub_map(
|
||||
MOSDRepScrub *repscrubop = new MOSDRepScrub(
|
||||
spg_t(info.pgid.pgid, replica.shard), version,
|
||||
get_osdmap()->get_epoch(),
|
||||
get_last_peering_reset(),
|
||||
start, end, deep, seed);
|
||||
// default priority, we want the rep scrub processed prior to any recovery
|
||||
// or client io messages (we are holding a lock!)
|
||||
|
Loading…
Reference in New Issue
Block a user