]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: OSDMap: remove pg temps for inexistent pools 3444/head
authorJoao Eduardo Luis <joao@redhat.com>
Wed, 21 Jan 2015 17:50:26 +0000 (17:50 +0000)
committerJoao Eduardo Luis <joao@redhat.com>
Thu, 22 Jan 2015 11:41:59 +0000 (11:41 +0000)
f513f66f48383a07c70ca18a4dba6c2449ea9860 prevented the monitor from
handling pg_temps on pools that had been removed (see issue #7116).
However it did not provide means to remove lingering pg_temps on
clusters that had been bit by #7116.  This patch makes sure to remove
any pg_temps associated with a non-existent pool.

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
src/osd/OSDMap.cc

index cc158617575f838d14fbdd0b7bfc4cc682333d1a..43c80826d28873658e8e5f812c3d43f4c08d8ffb 100644 (file)
@@ -1177,7 +1177,16 @@ void OSDMap::remove_redundant_temporaries(CephContext *cct, const OSDMap& osdmap
   for (map<pg_t,vector<int32_t> >::iterator p = osdmap.pg_temp->begin();
        p != osdmap.pg_temp->end();
        ++p) {
-    if (pending_inc->new_pg_temp.count(p->first) == 0) {
+
+    // if pool does not exist, remove any existing pg_temps associated with
+    // it.  we don't care about pg_temps on the pending_inc either; if there
+    // are new_pg_temp entries on the pending, clear them out just as well.
+    if (!osdmap.have_pg_pool(p->first.pool())) {
+      ldout(cct, 10) << " removing pg_temp " << p->first
+        << " for inexistent pool " << p->first.pool() << dendl;
+      pending_inc->new_pg_temp[p->first].clear();
+
+    } else if (pending_inc->new_pg_temp.count(p->first) == 0) {
       vector<int> raw_up;
       int primary;
       osdmap.pg_to_raw_up(p->first, &raw_up, &primary);