From: Samuel Just Date: Tue, 22 Mar 2016 21:20:12 +0000 (-0700) Subject: OSD::handle_pg_create: check same_primary_since X-Git-Tag: v10.1.1~49^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F8382%2Fhead;p=ceph.git OSD::handle_pg_create: check same_primary_since 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 --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 1bff914749155..f0401ff0e31d8 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -7479,15 +7479,28 @@ void OSD::handle_pg_create(OpRequestRef op) // 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())) ); }