]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: do not ->put() scrub messages when adding to a WorkQueue.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Tue, 6 Dec 2011 22:24:08 +0000 (14:24 -0800)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Tue, 6 Dec 2011 22:24:08 +0000 (14:24 -0800)
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 <gregory.farnum@dreamhost.com>
src/osd/PG.cc
src/osd/ReplicatedPG.cc

index a7565d1b7f758c5849ea0f32c9d117ca082c98a7..3261a404a99a3127dc2cfc42ef0d815a227b0eb2 100644 (file)
@@ -2609,11 +2609,12 @@ void PG::_scan_list(ScrubMap &map, vector<hobject_t> &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)
index 1e488b979289247b009976e6587a6cbad6cde33e..099045f19872e5947acc2fa61037811f9373caed 100644 (file)
@@ -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;
   }