Rather than add a flag to handle_pg_peering_evt, check
same_primary_since here and pass the create event to
handle_pg_peering_evt as if it originated at the current epoch (the
project_pg_history checks in handle_pg_peering_evt will be noops).
Fixes: tracker.ceph.com/issues/15241
Signed-off-by: Samuel Just <sjust@redhat.com>
// cannot be on the other side of a map gap
assert(valid_history);
+ // The mon won't resend unless the primary changed, so
+ // we ignore same_interval_since. We'll pass this history
+ // to handle_pg_peering_evt with the current epoch as the
+ // event -- the project_pg_history check in
+ // handle_pg_peering_evt will be a noop.
+ if (history.same_primary_since > m->epoch) {
+ dout(10) << __func__ << ": got obsolete pg create on pgid "
+ << pgid << " from epoch " << m->epoch
+ << ", primary changed in " << history.same_primary_since
+ << dendl;
+ continue;
+ }
+
handle_pg_peering_evt(
pgid,
history,
pi,
- m->epoch,
+ osdmap->get_epoch(),
PG::CephPeeringEvtRef(
new PG::CephPeeringEvt(
- m->epoch,
- m->epoch,
+ osdmap->get_epoch(),
+ osdmap->get_epoch(),
PG::NullEvt()))
);
}