From 73c59a022f011cb8d84ef5e8fed8df50846bd223 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 22 Feb 2014 09:29:15 -0800 Subject: [PATCH] mon/PGMap: fix osd_epochs update The insert() call here does not overwrite a previous entry, which means that the osd_epochs map is never moving forward in time. This seems to have been broken since it was introduced in 091809b814. Backport: emperor, dumpling Signed-off-by: Sage Weil --- src/mon/PGMap.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index ad2aacbf6db0..2d3d105cd48d 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -229,8 +229,9 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc) stat_osd_sub(t->second); t->second = new_stats; } - assert(inc.get_osd_epochs().find(osd) != inc.get_osd_epochs().end()); - osd_epochs.insert(*(inc.get_osd_epochs().find(osd))); + map::const_iterator j = inc.get_osd_epochs().find(osd); + assert(j != inc.get_osd_epochs().end()); + osd_epochs[j->first] = j->second; stat_osd_add(new_stats); -- 2.47.3