]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: drop RepGather::ondone callback
authorSage Weil <sage@inktank.com>
Thu, 19 Dec 2013 21:12:20 +0000 (13:12 -0800)
committerSage Weil <sage@inktank.com>
Fri, 20 Dec 2013 00:40:01 +0000 (16:40 -0800)
We kick the blocked contexts in the completion path of process_copy_chunk(),
after we have take the RWWRITE obc lock.  There is no need to delay the
unblocking until the RepGather finishes.

This also fixes a leak: the ondone wasn't getting cleaned up if a peering
interval change happens and the repgather is applied early in on_change().

Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index e17b67070e9753bf499b052a8bbd5e0cffcf41db..4de162153642689bf05094ac4ccd2e05f84024e5 100644 (file)
@@ -4938,8 +4938,6 @@ void ReplicatedPG::finish_promote(int r, OpRequestRef op,
   tctx->lock_to_release = OpContext::W_LOCK;
   dout(20) << __func__ << " took lock on obc, " << obc->rwstate << dendl;
 
-  repop->ondone = new C_KickBlockedObject(obc, this);
-
   finish_ctx(tctx);
   simple_repop_submit(repop);
 }
index 599f85d26df1cb3756a82dcbfe2315ebbfec12cb..d8d97deb7a2b46cbdb47cf4c094621e6d7fe31ee 100644 (file)
@@ -445,8 +445,6 @@ public:
     //bool sent_nvram;
     bool sent_disk;
     
-    Context *ondone; ///< if set, this Context will be activated when repop is done
-
     utime_t   start;
     
     eversion_t          pg_local_last_complete;
@@ -465,7 +463,6 @@ public:
       sent_ack(false),
       //sent_nvram(false),
       sent_disk(false),
-      ondone(NULL),
       pg_local_last_complete(lc),
       queue_snap_trimmer(false) { }
 
@@ -484,8 +481,6 @@ public:
     }
     void mark_done() {
       is_done = true;
-      if (ondone)
-       ondone->complete(0);
     }
     bool done() {
       return is_done;
@@ -1120,17 +1115,6 @@ public:
   void wait_for_blocked_object(const hobject_t& soid, OpRequestRef op);
   void kick_object_context_blocked(ObjectContextRef obc);
 
-  struct C_KickBlockedObject : public Context {
-    ObjectContextRef obc;
-    ReplicatedPG *pg;
-    C_KickBlockedObject(ObjectContextRef obc_, ReplicatedPG *pg_) :
-      obc(obc_), pg(pg_) {}
-  protected:
-    void finish(int r) {
-      pg->kick_object_context_blocked(obc);
-    }
-  };
-
   void mark_all_unfound_lost(int what);
   eversion_t pick_newest_available(const hobject_t& oid);
   ObjectContextRef mark_object_lost(ObjectStore::Transaction *t,