From f94c764638ca110085fc5469734d815fc016fd7a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 15 Jul 2012 22:03:31 -0700 Subject: [PATCH] mon: remove osds from [near]full sets when their stats are removed from pgmap 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 --- src/mon/PGMap.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index e56e4925e53bc..3ca710186dd82 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -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) -- 2.39.5