PG::Info::History history = it->history;
project_pg_history(pgid, history, m->get_epoch(), up, acting);
- if (m->get_epoch() < history.same_primary_since) {
- dout(10) << "handle_pg_notify pg " << pgid << " primary changed in "
- << history.same_primary_since << " (msg from " << m->get_epoch() << ")" << dendl;
+ if (m->get_epoch() < history.same_acting_since) {
+ dout(10) << "handle_pg_notify pg " << pgid << " acting changed in "
+ << history.same_acting_since << " (msg from " << m->get_epoch() << ")" << dendl;
continue;
}
} else {
// already had it. am i (still) the primary?
pg = _lookup_lock_pg(pgid);
- if (m->get_epoch() < pg->info.history.same_primary_since) {
- dout(10) << *pg << " handle_pg_notify primary changed in "
- << pg->info.history.same_primary_since
+ if (m->get_epoch() < pg->info.history.same_acting_since) {
+ dout(10) << *pg << " handle_pg_notify acting changed in "
+ << pg->info.history.same_acting_since
<< " (msg from " << m->get_epoch() << ")" << dendl;
pg->unlock();
continue;
created++;
} else {
pg = _lookup_lock_pg(info.pgid);
- if (epoch < pg->info.history.same_primary_since) {
+ if (epoch < pg->info.history.same_acting_since) {
dout(10) << *pg << " got old info " << info << ", ignoring" << dendl;
pg->unlock();
return;
dout(10) << " don't have pg " << m->pgid << dendl;
} else {
PG *pg = _lookup_lock_pg(m->pgid);
- if (m->epoch < pg->info.history.same_primary_since) {
+ if (m->epoch < pg->info.history.same_acting_since) {
dout(10) << *pg << " got old trim to " << m->trim_to << ", ignoring" << dendl;
pg->unlock();
goto out;
PG::Info::History history = it->second.history;
project_pg_history(pgid, history, m->get_epoch(), up, acting);
- if (m->get_epoch() < history.same_primary_since) {
+ if (m->get_epoch() < history.same_acting_since) {
dout(10) << " pg " << pgid << " dne, and pg has changed in "
- << history.same_primary_since << " (msg from " << m->get_epoch() << ")" << dendl;
+ << history.same_acting_since << " (msg from " << m->get_epoch() << ")" << dendl;
continue;
}
pg = _lookup_lock_pg(pgid);
// same primary?
- if (m->get_epoch() < pg->info.history.same_primary_since) {
- dout(10) << *pg << " handle_pg_query primary changed in "
- << pg->info.history.same_primary_since
+ if (m->get_epoch() < pg->info.history.same_acting_since) {
+ dout(10) << *pg << " handle_pg_query changed in "
+ << pg->info.history.same_acting_since
<< " (msg from " << m->get_epoch() << ")" << dendl;
pg->unlock();
continue;
{
dout(7) << "sub_op_scrub" << dendl;
- if (op->map_epoch < info.history.same_primary_since) {
+ if (op->map_epoch < info.history.same_acting_since) {
dout(10) << "sub_op_scrub discarding old sub_op from "
- << op->map_epoch << " < " << info.history.same_primary_since << dendl;
+ << op->map_epoch << " < " << info.history.same_acting_since << dendl;
delete op;
return;
}
void encode(bufferlist &bl) const {
::encode(epoch_created, bl);
::encode(last_epoch_started, bl);
- ::encode(same_up_since, bl);
::encode(same_acting_since, bl);
- ::encode(same_primary_since, bl);
+ ::encode(same_up_since, bl);
+ //::encode(same_primary_since, bl);
}
- void decode(bufferlist::iterator &bl, int v=0) {
+ void decode(bufferlist::iterator &bl) {
::decode(epoch_created, bl);
::decode(last_epoch_started, bl);
- if (v && v >= 20)
- ::decode(same_up_since, bl);
::decode(same_acting_since, bl);
- ::decode(same_primary_since, bl);
+ ::decode(same_up_since, bl);
+ //::decode(same_primary_since, bl);
}
} history;
::decode(log_tail, bl);
::decode(log_backlog, bl);
::decode(stats, bl);
- history.decode(bl, v);
+ history.decode(bl);
::decode(snap_trimq, bl);
}
};
{
return out << "ec=" << h.epoch_created
<< " les=" << h.last_epoch_started
- << " " << h.same_up_since << "/" << h.same_acting_since;
+ << " " << h.same_up_since << "/" << h.same_acting_since << "/" << h.same_primary_since;
}
inline ostream& operator<<(ostream& out, const PG::Info& pgi)
bool ReplicatedPG::same_for_read_since(epoch_t e)
{
- return (e >= info.history.same_primary_since);
+ return (e >= info.history.same_acting_since);
}
bool ReplicatedPG::same_for_modify_since(epoch_t e)
{
- return (e >= info.history.same_primary_since);
+ return (e >= info.history.same_acting_since);
}
bool ReplicatedPG::same_for_rep_modify_since(epoch_t e)
{
// check osd map: same set, or primary+acker?
- return e >= info.history.same_primary_since;
+ return e >= info.history.same_acting_since;
}
// ====================
<< dendl;
// sanity checks
- assert(op->map_epoch >= info.history.same_primary_since);
+ assert(op->map_epoch >= info.history.same_acting_since);
assert(is_active());
assert(is_replica());