]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: remove osds from [near]full sets when their stats are removed from pgmap
authorSage Weil <sage@inktank.com>
Mon, 16 Jul 2012 05:03:31 +0000 (22:03 -0700)
committerSage Weil <sage@inktank.com>
Mon, 16 Jul 2012 05:03:31 +0000 (22:03 -0700)
Greg points out that we could have a situation like:

 - mon recovers..
 - goes through osdmaps, notes an osd was removed and removes from
   full/nearfull
 - goes through pgmaps, and re-adds it when it encounters some osd_stat_ts.

Fix this by removing the osd from the full/nearfull set when we remove
the osd_stat_t from the pgmap.  Any osd removal is always followed by
an osd_stat_rm[] record when the primary processes the new osdmap and
proposed the appropriate pgmap updates.

Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/PGMap.cc

index e56e4925e53bc076834f93991b950b057d9b294c..3ca710186dd828349310140b290a30d94f0a4911 100644 (file)
@@ -218,6 +218,10 @@ void PGMap::apply_incremental(const Incremental& inc)
       stat_osd_sub(t->second);
       osd_stat.erase(t);
     }
+
+    // remove these old osds from full/nearfull set(s), too
+    nearfull_osds.erase(*p);
+    full_osds.erase(*p);
   }
   
   if (inc.osdmap_epoch)