From: Sage Weil Date: Thu, 19 Dec 2013 21:12:20 +0000 (-0800) Subject: osd/ReplicatedPG: drop RepGather::ondone callback X-Git-Tag: v0.75~45^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=923bff1dba11b0bb7d0d8f7b0cdec8c0064825b8;p=ceph.git osd/ReplicatedPG: drop RepGather::ondone callback 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index e17b67070e9..4de16215364 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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); } diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 599f85d26df..d8d97deb7a2 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -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,