]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix pg epoch floor tracking
authorSage Weil <sage@redhat.com>
Fri, 8 Aug 2014 00:42:06 +0000 (17:42 -0700)
committerSage Weil <sage@redhat.com>
Thu, 14 Aug 2014 00:21:18 +0000 (17:21 -0700)
If you call erase() on a multiset it will delete all instances of a value;
we only want to delete one of them.  Fix this by passing an iterator.

Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit a52a855f6c92b03dd84cd0cc1759084f070a98c2)

src/osd/OSD.h

index a8a1d08625f1a16a4bb7f7a7511d4c3e9e2a9f58..bc3eb4eaa74f4aa207c8577f883255f6b2d48b84 100644 (file)
@@ -350,7 +350,7 @@ public:
     Mutex::Locker l(pg_epoch_lock);
     map<spg_t,epoch_t>::iterator t = pg_epoch.find(pgid);
     assert(t != pg_epoch.end());
-    pg_epochs.erase(t->second);
+    pg_epochs.erase(pg_epochs.find(t->second));
     t->second = epoch;
     pg_epochs.insert(epoch);
   }
@@ -358,7 +358,7 @@ public:
     Mutex::Locker l(pg_epoch_lock);
     map<spg_t,epoch_t>::iterator t = pg_epoch.find(pgid);
     if (t != pg_epoch.end()) {
-      pg_epochs.erase(t->second);
+      pg_epochs.erase(pg_epochs.find(t->second));
       pg_epoch.erase(t);
     }
   }