{
dout(10) << __func__ << " " << pgid << " created " << created << dendl;
h->epoch_created = created;
+ h->epoch_pool_created = created;
h->same_interval_since = created;
h->same_up_since = created;
h->same_primary_since = created;
break;
}
- // base case: these floors should be the creation epoch if we didn't
+ // base case: these floors should be the pg creation epoch if we didn't
// find any changes.
if (e == h.epoch_created) {
if (!h.same_interval_since)
void pg_history_t::encode(bufferlist &bl) const
{
- ENCODE_START(8, 4, bl);
+ ENCODE_START(9, 4, bl);
::encode(epoch_created, bl);
::encode(last_epoch_started, bl);
::encode(last_epoch_clean, bl);
::encode(last_epoch_marked_full, bl);
::encode(last_interval_started, bl);
::encode(last_interval_clean, bl);
+ ::encode(epoch_pool_created, bl);
ENCODE_FINISH(bl);
}
void pg_history_t::decode(bufferlist::iterator &bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(8, 4, 4, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(9, 4, 4, bl);
::decode(epoch_created, bl);
::decode(last_epoch_started, bl);
if (struct_v >= 3)
last_interval_clean = last_epoch_clean; // best guess
}
}
+ if (struct_v >= 9) {
+ ::decode(epoch_pool_created, bl);
+ } else {
+ epoch_pool_created = epoch_created;
+ }
DECODE_FINISH(bl);
}
void pg_history_t::dump(Formatter *f) const
{
f->dump_int("epoch_created", epoch_created);
+ f->dump_int("epoch_pool_created", epoch_pool_created);
f->dump_int("last_epoch_started", last_epoch_started);
f->dump_int("last_interval_started", last_interval_started);
f->dump_int("last_epoch_clean", last_epoch_clean);
o.push_back(new pg_history_t);
o.push_back(new pg_history_t);
o.back()->epoch_created = 1;
+ o.back()->epoch_pool_created = 1;
o.back()->last_epoch_started = 2;
o.back()->last_interval_started = 2;
o.back()->last_epoch_clean = 3;
* history they need to worry about.
*/
struct pg_history_t {
- epoch_t epoch_created; // epoch in which PG was created
+ epoch_t epoch_created; // epoch in which *pg* was created (pool or pg)
+ epoch_t epoch_pool_created; // epoch in which *pool* was created
+ // (note: may be pg creation epoch for
+ // pre-luminous clusters)
epoch_t last_epoch_started; // lower bound on last epoch started (anywhere, not necessarily locally)
epoch_t last_interval_started; // first epoch of last_epoch_started interval
epoch_t last_epoch_clean; // lower bound on last epoch the PG was completely clean.
epoch_t last_interval_clean; // first epoch of last_epoch_clean interval
- epoch_t last_epoch_split; // as parent
+ epoch_t last_epoch_split; // as parent or child
epoch_t last_epoch_marked_full; // pool or cluster
/**
friend bool operator==(const pg_history_t& l, const pg_history_t& r) {
return
l.epoch_created == r.epoch_created &&
+ l.epoch_pool_created == r.epoch_pool_created &&
l.last_epoch_started == r.last_epoch_started &&
l.last_interval_started == r.last_interval_started &&
l.last_epoch_clean == r.last_epoch_clean &&
pg_history_t()
: epoch_created(0),
+ epoch_pool_created(0),
last_epoch_started(0),
last_interval_started(0),
last_epoch_clean(0),
epoch_created = other.epoch_created;
modified = true;
}
+ if (epoch_pool_created < other.epoch_pool_created) {
+ // FIXME: for jewel compat only; this should either be 0 or always the
+ // same value across all pg instances.
+ epoch_pool_created = other.epoch_pool_created;
+ modified = true;
+ }
if (last_epoch_started < other.last_epoch_started) {
last_epoch_started = other.last_epoch_started;
modified = true;
WRITE_CLASS_ENCODER(pg_history_t)
inline ostream& operator<<(ostream& out, const pg_history_t& h) {
- return out << "ec=" << h.epoch_created
+ return out << "ec=" << h.epoch_created << "/" << h.epoch_pool_created
<< " lis/c " << h.last_interval_started
<< "/" << h.last_interval_clean
<< " les/c/f " << h.last_epoch_started << "/" << h.last_epoch_clean