]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
bug fix: osd: requeue_scrub when kick_object_context_blocked 5891/head
authorXinze Chi <xmdxcxz@gmail.com>
Wed, 29 Jul 2015 08:28:33 +0000 (16:28 +0800)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Mon, 21 Sep 2015 11:17:27 +0000 (16:47 +0530)
when read miss in writeback cache pool, osd do_proxy_read first
and maybe promote it. but in this case, the op is not added to
waiting_for_blocked_object. pg scrub maybe block by this object
(_range_available_for_scrub). so after promote it, we should
requeue_scrub.

Fixes: 12515
Signed-off-by: Xinze Chi <xmdxcxz@gmail.com>
(cherry picked from commit f77949fedce3449befd74efeb5270579f5085b16)

Conflicts:
src/osd/ReplicatedPG.cc
in ReplicatedPG::kick_object_context_blocked, removed hobject_t::BitwiseComparator from map p

src/osd/ReplicatedPG.cc

index 6b22c3a845a68c942bcc1e73794dd466464d6110..fd20cf96426b106056cd1959462cd31d9b11c26b 100644 (file)
@@ -8088,19 +8088,18 @@ void ReplicatedPG::add_object_context_to_pg_stat(ObjectContextRef obc, pg_stat_t
 void ReplicatedPG::kick_object_context_blocked(ObjectContextRef obc)
 {
   const hobject_t& soid = obc->obs.oi.soid;
-  map<hobject_t, list<OpRequestRef> >::iterator p = waiting_for_blocked_object.find(soid);
-  if (p == waiting_for_blocked_object.end())
-    return;
-
   if (obc->is_blocked()) {
     dout(10) << __func__ << " " << soid << " still blocked" << dendl;
     return;
   }
 
-  list<OpRequestRef>& ls = p->second;
-  dout(10) << __func__ << " " << soid << " requeuing " << ls.size() << " requests" << dendl;
-  requeue_ops(ls);
-  waiting_for_blocked_object.erase(p);
+  map<hobject_t, list<OpRequestRef> >::iterator p = waiting_for_blocked_object.find(soid);
+  if (p != waiting_for_blocked_object.end()) {
+    list<OpRequestRef>& ls = p->second;
+    dout(10) << __func__ << " " << soid << " requeuing " << ls.size() << " requests" << dendl;
+    requeue_ops(ls);
+    waiting_for_blocked_object.erase(p);
+  }
 
   if (obc->requeue_scrub_on_unblock)
     osd->queue_for_scrub(this);