From 03b03553b2e386b4c102e24bf90f88297a0f61e7 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Tue, 6 Dec 2011 14:24:08 -0800 Subject: [PATCH] ReplicatedPG: do not ->put() scrub messages when adding to a WorkQueue. This function is passing a reference from PG::active_rep_scrub to the req_scrub_wq, not eliminating the reference (and the WorkQueue doesn't grab a new reference itself, either). The other alternative is to convert the WorkQueue to grab a reference, but since they can cycle through the WorkQueue more than once, and need to be ->put() outside the WorkQueue, I don't like that option. This should fix #1758. Also add an assert to PG::_request_scrub_map to check on the other possible cause of this bug (and fix the indentation). Signed-off-by: Greg Farnum --- src/osd/PG.cc | 11 ++++++----- src/osd/ReplicatedPG.cc | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index a7565d1b7f758..3261a404a99a3 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2609,11 +2609,12 @@ void PG::_scan_list(ScrubMap &map, vector &ls) void PG::_request_scrub_map(int replica, eversion_t version) { - dout(10) << "scrub requesting scrubmap from osd." << replica << dendl; - MOSDRepScrub *repscrubop = new MOSDRepScrub(info.pgid, version, - get_osdmap()->get_epoch()); - osd->cluster_messenger->send_message(repscrubop, - get_osdmap()->get_cluster_inst(replica)); + assert(replica != osd->whoami); + dout(10) << "scrub requesting scrubmap from osd." << replica << dendl; + MOSDRepScrub *repscrubop = new MOSDRepScrub(info.pgid, version, + get_osdmap()->get_epoch()); + osd->cluster_messenger->send_message(repscrubop, + get_osdmap()->get_cluster_inst(replica)); } void PG::sub_op_scrub_reserve(MOSDSubOp *op) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 1e488b9792892..099045f19872e 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -3437,7 +3437,6 @@ void ReplicatedPG::sub_op_modify_applied(RepModify *rm) if (last_update_applied == info.last_update && finalizing_scrub) { assert(active_rep_scrub); osd->rep_scrub_wq.queue(active_rep_scrub); - active_rep_scrub->put(); active_rep_scrub = 0; } -- 2.39.5