]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: fix recovering hang when have unfound objects 16558/head
authorhuangjun <huangjun@xsky.com>
Tue, 25 Jul 2017 11:08:31 +0000 (11:08 +0000)
committerhuangjun <huangjun@xsky.com>
Tue, 25 Jul 2017 11:08:31 +0000 (11:08 +0000)
  pg_log.get_missing() return type is pg_missing_tracker_t,
  if we use:
    const pg_missing_t &missing = pg_log.get_missing();
  the reference object(missing) will not change when we changed the
  pglog's missing set in recover_primary()/recover_got(),which will
  result the recovering hang.

Signed-off-by: huangjun <huangjun@xsky.com>
src/osd/PrimaryLogPG.cc

index 69e14f73cc219c03483388c2595ab7b48d587286..a088b6caae7677dfdb8931e2557555a9ac3aa3ee 100644 (file)
@@ -918,7 +918,7 @@ int PrimaryLogPG::do_command(
   ConnectionRef con,
   ceph_tid_t tid)
 {
-  const pg_missing_t &missing = pg_log.get_missing();
+  const auto &missing = pg_log.get_missing();
   string prefix;
   string format;
 
@@ -11136,7 +11136,7 @@ bool PrimaryLogPG::start_recovery_ops(
     return false;
   }
 
-  const pg_missing_t &missing = pg_log.get_missing();
+  const auto &missing = pg_log.get_missing();
 
   unsigned int num_missing = missing.num_missing();
   uint64_t num_unfound = get_num_unfound();
@@ -11276,7 +11276,7 @@ uint64_t PrimaryLogPG::recover_primary(uint64_t max, ThreadPool::TPHandle &handl
 {
   assert(is_primary());
 
-  const pg_missing_t &missing = pg_log.get_missing();
+  const auto &missing = pg_log.get_missing();
 
   dout(10) << "recover_primary recovering " << recovering.size()
           << " in pg" << dendl;