]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix up handling of dup PG::Info
authorSage Weil <sage@newdream.net>
Thu, 8 Oct 2009 21:20:52 +0000 (14:20 -0700)
committerSage Weil <sage@newdream.net>
Thu, 8 Oct 2009 21:20:52 +0000 (14:20 -0700)
Ignore dup info.  Simplify broken logic.

src/osd/OSD.cc

index f489f585fa718469429206f1ae05662f34532311..2f72e3d513a1959d7b7edfd39e1cd55756fa739e 100644 (file)
@@ -2845,30 +2845,21 @@ void OSD::handle_pg_notify(MOSDPGNotify *m)
       }
     }
 
-    // ok!
-    dout(10) << *pg << " got osd" << from << " info " << *it << dendl;
-    pg->info.history.merge(it->history);
-
-    // save info.
-    bool had = pg->peer_info.count(from);
-    pg->peer_info[from] = *it;
-
-    // stray?
-    bool acting = pg->is_acting(from);
-    if (!acting) {
-      if (pg->stray_purged.count(from)) {
-       dout(10) << *pg << " osd" << from << " sent racing info " << *it << "; already purging/purged" << dendl;
-      } else {
+    if (pg->peer_info.count(from) &&
+       pg->peer_info[from].last_update == it->last_update) {
+      dout(10) << *pg << " got dup osd" << from << " info " << *it << dendl;
+    } else {
+      dout(10) << *pg << " got osd" << from << " info " << *it << dendl;
+      pg->peer_info[from] = *it;
+      pg->info.history.merge(it->history);
+
+      // stray?
+      if (!pg->is_acting(from)) {
        dout(10) << *pg << " osd" << from << " has stray content: " << *it << dendl;
        pg->stray_set.insert(from);
        pg->state_clear(PG_STATE_CLEAN);
       }
-    }
-
-    if (had) {
-      // hmm, maybe keep an eye out for cases where we see this, but peer should happen.
-      dout(10) << *pg << " hmm, already had notify info from osd" << from << ": " << *it << dendl;
-    } else {
+      
       pg->peer(t, query_map, &info_map);
       pg->update_stats();
     }