]> git.apps.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)
committerDavid Zafman <dzafman@redhat.com>
Fri, 17 Jun 2016 19:28:48 +0000 (12:28 -0700)
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>
(cherry picked from commit d51806f5b330d5f112281fbb95ea6addf994324e)

src/osd/PG.cc

index fc2f6689d439f3b8621c956dc9cee0fc609546cd..3266d5e56553d248999dbf9ad187c8a62249f133 100644 (file)
@@ -3744,15 +3744,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;
   }
 }