]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: conditionally retry on receiving pg-notify when Primary is Incomplete
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 13 Mar 2017 08:20:15 +0000 (16:20 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 14 Mar 2017 10:56:56 +0000 (18:56 +0800)
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 <xie.xingguo@zte.com.cn>
src/osd/PG.cc

index 3a75d8932e92829d7c28ef3dbbf4dcbe3e9e164b..1a0c66d6d03324f102a974436a5a045abeab3659 100644 (file)
@@ -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();
   }
 }