]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: forget pushes to newly stray osds
authorSage Weil <sage@newdream.net>
Fri, 8 Aug 2008 23:15:47 +0000 (16:15 -0700)
committerSage Weil <sage@newdream.net>
Fri, 8 Aug 2008 23:15:47 +0000 (16:15 -0700)
src/osd/ReplicatedPG.cc

index 69e636fa7b156057f38a548c130ab007040278f4..a704bcdb0929d9da7209f327b03c64f928f8ebd6 100644 (file)
@@ -1686,6 +1686,31 @@ void ReplicatedPG::on_change()
       }
     }
   }
+  
+  // remove strays from pushing map
+  {
+    map<object_t, set<int> >::iterator p = pushing.begin();
+    while (p != pushing.end()) {
+      set<int>::iterator q = p->second.begin();
+      while (q != p->second.end()) {
+       int o = *q++;
+       bool have = false;
+       for (unsigned i=1; i<acting.size(); i++)
+         if (acting[i] == o) {
+           have = true;
+           break;
+         }
+       if (!have) {
+         dout(10) << " forgetting push of " << p->first << " to (now stray) osd" << o << dendl;
+         p->second.erase(o);
+       }
+      }
+      if (p->second.empty())
+       pushing.erase(p++);
+      else
+       p++;    
+    }
+  }
 }
 
 void ReplicatedPG::on_role_change()