]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Fix ec pg repair endless when met unrecover object.
authorJianpeng Ma <jianpeng.ma@intel.com>
Tue, 14 Apr 2015 01:11:58 +0000 (09:11 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Wed, 22 Apr 2015 01:47:50 +0000 (09:47 +0800)
In repair_object, if bad_peer is replica, it don't add soid in
MissingLoc for ec pool. If there are more bad replica for ec pool
which cause object can't recover, the later recoverying will endless.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/PG.cc

index 03bf405ea03121a4adb4d5a800744515a6b93dc4..7c4c6975b12f55c1ccfecdd6dc6533e0c2a339c4 100644 (file)
@@ -3667,15 +3667,20 @@ void PG::repair_object(
     assert(waiting_for_unreadable_object.empty());
 
     pg_log.missing_add(soid, oi.version, eversion_t());
+
+    pg_log.set_last_requested(0);
+    dout(10) << __func__ << ": primary = " << primary << dendl;
+  }
+
+  if (is_ec_pg() || bad_peer == primary) {
+    // we'd better collect all shard for EC pg, and prepare good peers as the
+    // source of pull in the case of replicated pg.
     missing_loc.add_missing(soid, oi.version, eversion_t());
     list<pair<ScrubMap::object, pg_shard_t> >::iterator i;
     for (i = ok_peers->begin();
-        i != ok_peers->end();
-        ++i)
+       i != ok_peers->end();
+       ++i)
       missing_loc.add_location(soid, i->second);
-
-    pg_log.set_last_requested(0);
-    dout(10) << __func__ << ": primary = " << primary << dendl;
   }
 }