]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
bug fix: osd: requeue_scrub when kick_object_context_blocked 5396/head
authorXinze Chi <xmdxcxz@gmail.com>
Wed, 29 Jul 2015 08:28:33 +0000 (16:28 +0800)
committerXinze Chi <xmdxcxz@gmail.com>
Tue, 25 Aug 2015 03:22:05 +0000 (11:22 +0800)
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>
src/osd/ReplicatedPG.cc

index 08a29c735af7af4c2a4ca50cda023444f567e8f5..67a8a881185128efc900311692a8859d3668b58f 100644 (file)
@@ -8467,19 +8467,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>, hobject_t::BitwiseComparator>::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>, hobject_t::BitwiseComparator>::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);
+  }
 
   map<hobject_t, ObjectContextRef>::iterator i =
     objects_blocked_on_snap_promotion.find(obc->obs.oi.soid.get_head());