]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: fix osd_epochs update 1304/head
authorSage Weil <sage@inktank.com>
Sat, 22 Feb 2014 17:29:15 +0000 (09:29 -0800)
committerSage Weil <sage@inktank.com>
Sun, 23 Feb 2014 20:15:27 +0000 (12:15 -0800)
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 <sage@inktank.com>
src/mon/PGMap.cc

index ad2aacbf6db096a0df36e4f49a852093525728df..2d3d105cd48d6ced6e4a9e0dee63350f03fdce3a 100644 (file)
@@ -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<int32_t,epoch_t>::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);