From: xie xingguo Date: Mon, 13 Mar 2017 08:20:15 +0000 (+0800) Subject: OSD: conditionally retry on receiving pg-notify when Primary is Incomplete X-Git-Tag: v12.0.1~5^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2df1a265a262cc5bcd79a71c6b89203114609168;p=ceph.git OSD: conditionally retry on receiving pg-notify when Primary is Incomplete If the pg info sent by the peer is identical to ours, or it is from a down OSD, we can simply ignore and no action shall be taken. Signed-off-by: xie xingguo --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 3a75d8932e92..1a0c66d6d033 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -7763,16 +7763,12 @@ boost::statechart::result PG::RecoveryState::Incomplete::react(const AdvMap &adv boost::statechart::result PG::RecoveryState::Incomplete::react(const MNotifyRec& notevt) { PG *pg = context< RecoveryMachine >().pg; ldout(pg->cct, 7) << "handle_pg_notify from osd." << notevt.from << dendl; - if (pg->peer_info.count(notevt.from) && - pg->peer_info[notevt.from].last_update == notevt.notify.info.last_update) { - ldout(pg->cct, 10) << *pg << " got dup osd." << notevt.from << " info " << notevt.notify.info - << ", identical to ours" << dendl; - return discard_event(); - } else { - pg->proc_replica_info( - notevt.from, notevt.notify.info, notevt.notify.epoch_sent); - // try again! + if (pg->proc_replica_info( + notevt.from, notevt.notify.info, notevt.notify.epoch_sent)) { + // We got something new, try again! return transit< GetLog >(); + } else { + return discard_event(); } }