]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: populate_obc_watchers when object pulled to primary
authorSage Weil <sage@newdream.net>
Mon, 9 Jan 2012 00:23:55 +0000 (16:23 -0800)
committerSage Weil <sage@newdream.net>
Mon, 9 Jan 2012 00:23:55 +0000 (16:23 -0800)
We don't care about degraded state, only whether the object is on the
primary so that we can load the object_info_t.

In particular, this avoids problems with backfill, where an object is
not degraded and populated, is then degraded while we backfill to the
target, and then not degraded again, and populate_obc_watchers() is called
a second time.

Fixes: #1903
Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/ReplicatedPG.cc

index a03b27b32ceaf6cf87eeb2abdb9540836b0aaf46..548a56041d6d3e161c017994028e8043a0bf3a16 100644 (file)
@@ -4288,7 +4288,6 @@ void ReplicatedPG::finish_degraded_object(const hobject_t& oid)
   map<hobject_t, ObjectContext *>::iterator i = object_contexts.find(oid);
   if (i != object_contexts.end()) {
     i->second->get();
-    populate_obc_watchers(i->second);
     for (set<ObjectContext*>::iterator j = i->second->blocking.begin();
         j != i->second->blocking.end();
         i->second->blocking.erase(j++)) {
@@ -4383,6 +4382,8 @@ void ReplicatedPG::_applied_pushed_object(ObjectStore::Transaction *t, ObjectCon
 {
   lock();
   dout(10) << "_applied_pushed_object " << *obc << dendl;
+  if (is_primary())
+    populate_obc_watchers(obc);
   put_object_context(obc);
   unlock();
   delete t;